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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

setting read only on text box 1

Status
Not open for further replies.

NickMalloy

Programmer
Joined
Apr 15, 2005
Messages
68
Location
US
I want to set a textbox to read only through javascript. My script should first set a textbox to a value of 0.00 and then make it read only. The 0.00 works fine.

f.MeritPC(i).value = "0.00";
f.MeritPC(i).readonly = true;
 
From the following site:
The boolean READONLY attribute, new in HTML 4.0 and poorly supported by current browsers, prevents the user from editing the content of the text or password input types. Read-only elements are still submitted with the form. The DISABLED attribute, which applies to all input types but is also poorly supported, disables the control. Disabled elements are read-only elements with the added restrictions that the values are not submitted with the form, the elements cannot receive focus, and the elements are skipped when navigating the document by tabbing.

I can only assume that the browser you are using is one of the "poorly supported by current browsers" ones they talk about.

Cheers,
Jeff
 
Ah. I see the problem...

Code:
f.MeritPC(i).read[COLOR=red]O[/color]nly = true;

It's all in the capitalisation.

Cheers,
Jeff
 
I knew it was something simply. Thanks Jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top