PDA

View Full Version : Need help with a text area


D*H*DGirlz:SexYNurseY
01-10-2000, 14:04
I know its possible that u can pre-define the contents of a text area...but..is it possible to stop the user from editing this text area when it is previewed in a browser?
As the information which is initially selected i do not want to be modified or changed by the user.
Can this be done usin standard html or will i have to use perl, javascript etc
If any u guys can help or know the answer can u help me oooout!
regards

SUNBURN

Jinx M
03-10-2000, 11:52
Why on Earth would you want to do this? :)

Anyway... This will sort of do it.


<form action="put your action here" name="theform" id="theform">
<textarea cols="35" rows="10"
name="jinxed" id="jinxed"
onMouseOut="theform.jinxed.value = 'This is the content'"
onKeyPress="theform.jinxed.value = 'This is the content'"
onKeyDown="theform.jinxed.value = 'This is the content'"
onKeyUp="theform.jinxed.value = 'This is the content'">
This is the content
</textarea>


Basically, when you press a key, release a key, hold down a key it will change the content to be "This is the content". It makes it impossible to change. But why why why are you doing it? If its for a form where you want to control that input wouldn't a hidden field be better? Print on the screen the value and have:

<input type="hidden" name="jinxed" value="This is the content">

in the page.