View Full Version : Textarea Script

08-12-2004, 03:48 PM

i need to know the javascript to make a textarea partially non-editable. i have a textarea in a form which has some lines by default. now i dont want the user to be able to edit those lines.. if user needs to write something then he can append his comments from the next line of my defaulted text. can anyone please help me with this..

thanks, :o

Roy Sinclair
08-12-2004, 04:45 PM
The simplest solution is to not put the text into the textbox in the first place. Any other solution is likely to be rather complex and hard to use.

08-12-2004, 06:01 PM
You could have the defaulted lines erased when focus is placed on the textarea and then when they submit the form you could attach them to the entered text before the form is sent on its way.

08-12-2004, 07:58 PM
Or maybe:

<p>Your default lines go here.</p>
<textarea cols="70" rows="10" name="messageArea" wrap="soft"></textarea>
<input type="hidden" name="defaultLines" value="Your default lines go here, too." />