Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set a text box to non updateable

Status
Not open for further replies.

danmul

Programmer
Jan 16, 2003
89
IE
Is it possible to set a text box to non updateable, I just want users to be able to view the data but for it to look the same as the rest of the fields. Also is it possible to change this value via javascript??
 
set it to readonly
<input type=&quot;text&quot; readonly>

you can change the value with javascript fairly easy.
reference the name of the form value and set the value in quotes.
document.form name.field name.value = &quot; &quot;
so if you ahve a form named myForm and a text box named myTxt and you want to set it to say this txt then
<script language=&quot;javascript&quot;>
document.myForm.myTxt.value = &quot;this Txt&quot;;
</script>

_______________________________________________
{ str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
ptr = /sleep/gi;Nstr = str.replace(ptr,&quot;coffee&quot;);alert(Nstr); }

_______________________________________________
for the best results to your questions: FAQ333-2924
has you're questio
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top