View Full Version : Textarea partially readonly
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.
05-24-2012, 04:24 PM
You need two textareas, or a contenteditable element. A textarea is readonly or not readonly.
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) :)
<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>
<textarea id=t2 style="border:0; overflow: auto;" cols=40 rows=10></textarea>
<input type=button value="Merge Results" onclick="this.form.t3.value=this.form.t1.value+' '+this.form.t2.value;">
<textarea id=t3 cols=40 rows=10></textarea>
05-25-2012, 04:31 AM
It works and I learned a new concept.Thx guys
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.