I have a few checkbox groups in my form . I would like to enable or disable them based on some values chosen in option boxes. I have the following code, the disableGroup function is a variation of enableGroup function from this example
in radio button :
Expand|Select|Wrap|Line Numbers
- onclick="javascript:disableSomething()"
Expand|Select|Wrap|Line Numbers
- function disableSomthing()
- {
- var name1 = 'checkboxgroup1';
- var name2 = 'checkboxgroup2';
- var formname = 'theFormName';
- disableGroup(name1,formname);
- disableGroup(name2,formname);
- ..............
- }
- function disableGroup(name, form) {
- var group = form.elements[name];
- for(var i = 0, n = group.length; i < n; ++i) {
- group[i].disabled = true;
- }
- }
"elements is null or not an object".
I have tried to figure out what is wrong but failed.Could you please have a look at my code and advise ? I'd be grateful.
Regards
Vajra