So I have a form that lets me choose one of three templates to submit with. Each template is inside a <fieldset> tag. What I'd like to do is call disable ('fieldsetID') and have it disable the fieldset and all form fields inside it... I _thought_ disabling the fieldset would do that for me, but apparently not.
Sooo, how would one go about doing this? I have this so far, and I think it's a decent start:
disable = function ()
for (i = 0; i < disable.arguments.length; i++)
// Is it an array of objects?
if (typeof disable.arguments[i] == 'object')
for (j = 0; j < disable.arguments[i].length; j++)
disable.arguments[i][j].disabled = true;
// Just an id
document.getElementById (disable.arguments[i]).disabled = true;
disable (document.getElementById ('fieldset').childNodes);
But it doesn't work, and it certainly doesn't disable form elements only.
This is pretty much for Mozilla only, but an IE version would be cool if possible.
Thanks for any guidance,