This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes readonly field Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "readonly field" Watch "readonly field" New topic

readonly field

shan Iyer
Ranch Hand

Joined: Jul 13, 2005
Posts: 391

When I click a radio button , i want to make 2 fields readonly, after populating the fields.
BUT....doucument.<formname>.<propertyname>.raedonly=true; does not work!!!
I DONT want to disable the fields, but make it readonly.

My entire code is like this:::::::
function setToList(selected,popupName){
if (document.<formname>.radioButton[0].checked == true)

// populating field one
document.<formname>.<propertyname>.value = column[3];

//making field one readonly(does not work)

// populating field two
document.<formname>.<propertyname>.value = column[4];

//making field two readonly(does not work)

[ December 22, 2005: Message edited by: shankar Iyer ]
[ December 22, 2005: Message edited by: Bear Bibeault ]

Warm Regards, S.Iyer
Niki Nono
Ranch Hand

Joined: Mar 20, 2005
Posts: 256

.raedOnly = true

case sensitive.

Life called,so here I am.<br />Cheers<br />Niki.:-)
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15376
You fat fingered your line:

It should be:
.readOnly = true;

Niki Nono
Ranch Hand

Joined: Mar 20, 2005
Posts: 256
ya i did that on purpose cuz i figured your server would recognize readOnly as some kind of special character and disallow it..

anyways now i know it allows it.
shan Iyer
Ranch Hand

Joined: Jul 13, 2005
Posts: 391
It is "readOnly" case-sensitive!!!
Wasted half a workday on such a silly thing!!!

subject: readonly field
Similar Threads
populating jsp through javascript
populating jsp fields through javascript
making readonly form fields editable dynamically
hbm.xml file does an update instead of an insert- Helppppp
Making a input text field readonly..