I am trying to disable some dropdown lists and radio buttons if certain values are retrieved from a table in the db. If A came back, i'd like to disable a set of radio buttons and two select boxes.
I am painting a form on a jsp, and I would like to disable radiobuttons and dropdown menus based on what the user picks earlier in the form. disabled = true doesn't seem to be working.
If you can suggest anything else, I would appreciate it.
thx,
M@
I'm assuming that you are using javascript to validate your form?..If your form name is myForm and the thing you want to grey out is myElement it would be
Code:
if (whatever == "a") {
document.myForm.myElement.disabled = true;
}
it might not work on dropdowns..I'm not sure but I know it will work on radio buttons
Thanks for all of the help. When I want to disable, I have to actually name which radiobutton I want disabled since there is more than one in the group (ie small medium or large and I want to disable small if childFlag = 'Y').
ie - document.forms[0].rbSeating[2].disabled = true ;
this disables the 3rd button in the list.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.