File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Lock Textfields

 
Lauren Pender
Greenhorn
Posts: 5
  • 0
  • 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
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Dave!
 
xavier romea
Ranch Hand
Posts: 37
  • 0
  • 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