...

View Full Version : Textarea partially readonly



arjun.nanda
05-24-2012, 03:41 PM
When the screen appears, the text within the textarea should be in readonly mode and user should be able to continue to enter after the readonly text.

mrhoo
05-24-2012, 04:24 PM
You need two textareas, or a contenteditable element. A textarea is readonly or not readonly.

EpicWebDesign
05-24-2012, 07:13 PM
You could always do a total kludge if you wanted your viewers to think they were entering text into the same textarea... see example below. Of course the "Merge Data" button would be your submit button, the div style could be in your CSS file, and the last textarea should be set to hidden. It's an ugly solution from a coding standpoint, but it would meet your criteria (sort of) :)


<form>
<div id=faketextarea style="border:1px solid #e3e3e3; width:375;">
<textarea id=t1 readonly style="border:0; overflow: auto;" cols=40 rows=1>This is the readonly text</textarea>
<BR>
<textarea id=t2 style="border:0; overflow: auto;" cols=40 rows=10></textarea>
</div><BR>
<input type=button value="Merge Results" onclick="this.form.t3.value=this.form.t1.value+' '+this.form.t2.value;">
<BR>
<textarea id=t3 cols=40 rows=10></textarea>
</form>

arjun.nanda
05-25-2012, 04:31 AM
It works and I learned a new concept.Thx guys



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum