Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Lock Textfields

 
Lauren Pender
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you lock a textfield so that javascript can change the value in the textfield, but a user cannot?
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lauren
Set the textfield to readonly
<INPUT TYPE="text" NAME="filedName" value=whatever readonly>
hope that helps
Dave
 
Lauren Pender
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Dave!
 
xavier romea
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
The readonly option only works for IE, doesn't it?
I tried on Netscape 4.7 and it doesn't work. I used the onFocus option of the input tag and set: onFocus="this.blur()"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic