This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Lock Textfields Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Lock Textfields" Watch "Lock Textfields" New topic
Author

Lock Textfields

Lauren Pender
Greenhorn

Joined: Jun 15, 2001
Posts: 5
How do you lock a textfield so that javascript can change the value in the textfield, but a user cannot?
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
Lauren
Set the textfield to readonly
<INPUT TYPE="text" NAME="filedName" value=whatever readonly>
hope that helps
Dave

Dave
Lauren Pender
Greenhorn

Joined: Jun 15, 2001
Posts: 5
Thanks Dave!
xavier romea
Ranch Hand

Joined: Jun 28, 2001
Posts: 37
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()"
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Lock Textfields
 
Similar Threads
Add Enter Key Value in Input Box
Jtable, Jtextarea
WA #1.....word association
Lets play a word game...
Owner in database