textarea

Creating a textarea with auto-resize

There was another thread about this, which I've tried. But there is one problem: the textarea doesn't shrink if you delete the content. I can't find any way to shrink it to the correct size - the clientHeight value comes back as the full size of the textarea, not its contents. The code from that page is below. I'd appreciate any help or...

JTextArea - very small size with long text

I'm using a JTextArea to display a long text JTextArea _definition = new JTextArea(5, 50); with word-wrap _definition.setLineWrap(true); _definition.setWrapStyleWord(true); embedded in a JScrollPane add(new JScrollPane(_definition), gbc); All that is part of a JPanel with the GridBagLayout. Everything is working fine with short...

WYSIWYG textarea component security

Really my question has more to do with the server-side scrubbing of html that's accepted via the WYSIWYG form component. Right now I'm leaning toward using htmlpurifier.org's library. I'm using php strip_tags() function elsewhere. Anyone have an advice/preferences/recommendations? ...

Detecting drop into textarea with Javascript

All I need is to be able to detect when text is dropped into a Textarea. I then take that text and do stuff with it and clear the textarea. There may be many of these textareas and very high UI expectations, so polling is a last resort. For IE, "onfocus" does the trick, since this event is fired after the user drops stuff into the tex...

jQuery- Call function when textarea wraps to a new line?

I'd like to increase the height of a textarea when the text wraps to a new line, so it dynamically expands to whatever it needs to be. I don't want to use the onscroll event because I want the expansion to always be one step ahead of the scrolling, so the textarea never scrolls until it reaches a max height of x. Anyway I could do this?...

How to set the initial text an a TinyMCE textarea?

I'm in a curious situation where I previously had no problem achieving what I'm looking for. The following code is a part of an HTML page which is to host a TinyMCE rich textbox: ... <textarea id="editing_field">This text is supposed to appear in the rich textbox</textarea> ... At first this worked as intended, creating a rich textbox...

How does Google mail achieve rtf in textarea?

I am intended to develop a rich input textarea similar to Google mail. Any ideal or resource to share? Thanks in advance! ...

How do you programmatically move the caret of a Flex TextArea to the end?

I'm trying to move the caret in a Flex TextArea to the end after appending some text from my code. I've looked through the reference documentation for TextArea and its underlying TextField but it appears there is no method provided to handle this. One approach I've tried is to set focus to the text area and dispatch a KeyUp KeyboardEven...

Prototype plugin for dynamically expanding textarea

Does anyone know of a good plugin for prototype which allows textareas to automatically expand / contract based on how much text there is in them (e.g. a line is added the area gets bigger, a line is removed it gets smaller)? I need one thats free to use (e.g. some form of GPL type license). ...

Using XSLT to output an empty HTML textarea element

When attempting to output an empty textarea element, the .NET XSLT processor collapses the element to its short form. Instead of this: <textarea id="blah" name="blah"></textarea> I get this: <textarea id="blah" name="blah"/> Which causes many web browsers (including IE and Firefox) to render the rest of the page as if it were the c...

Limiting number of lines in textarea

Hi, I'm looking for a javascript that can limit the number of lines (by line I mean some text ended by user pressing enter on the keyboard) the user is able to enter in textarea. I've found some solutions but they simply don't work or behave really weird. The best solution would be a jquery plugin that can do the work - something like C...

Flex: Modifying Text Area

I'm making a text editor using Text Area. Which user can change font size, family and etc. This is my code on as: private function ChangeFont(event: Event):void { var mySelectedTextRange:TextRange = new TextRange(thistxtarea,true, thistxtarea.selectionBeginIndex, ...

How can you move the cursor to the last position of a textarea in Javascript?

I have a textarea and a button on a form. The textarea may already have some text in it. I would like the cursor to move to the last position in the text area when the button is clicked. Is this possible? ...

Dynamically Scrolling a Textarea

Hello All I have a textarea html element on my page that gets reloaded via ajax. The whole textarea is returned each time not just its content, and the content grows over time. Along with the textarea i return the following piece of javascript: <script type="text/javascript" > var textArea = document.getElementById('outputTextResult...

How wide is a text area column?

If I specify a text area on a web page X columns wide and I have a variable-width font, how wide is the text area? What is a column unit? Is it the width of the widest character? The mean width? Average? Or perhaps some width unit regardless of the font given? ...

how remove wordwrap from textarea

hi there, my simple textarea doesn't show horizontal bar when text overflow, it wrap text for a new line, so how remove wordwrap and display horizontal bar when text overflow ? god bless! ...

Selective Validation

I have a form that have many text fields and all are being validated, I also added the NiceEdit plugin to be able to format text in my text areas, but it is raising errors like: A potentially dangerous Request.Form value was detected from the client Now I can simply go to the top of the page and in the page directive add ValidateReques...

How can I get a mx:textarea height to be the same as the content

The initial height of a text area is much larger than the content, I cannot find a way of making it always the same height as the text content: <mx:TextArea id="textarea" borderStyle="solid" width="100%" wordWrap="true" selectable="false" backgroundAlpha="0" focusAlpha="0" text="this is a little test" /> Gives a bordered box that is m...

Textarea CSS IE7 and "enter key" creating inline space.

Hi, Under ie7 i have a strange problem on textareas. When i type something in and push enter a space seems to be added instead if making a new line. It seems to be CSS related since when i remove Javascript the bug is still there. And when i remove CSS it works as expected. When i remove all mentions of textarea in my styling the bu...

Display Selectbox at Cursor Position in Textarea (dir="rtl")

Hello, sorry first my English language is not good. I have developed this autosuggest script for IE (script demo). The method is from this author: character position in textarea. The problem is when I put into the textarea dir="rtl", while the Arab written from right to left. Then I can not define the position from cursor. And OffsetLef...