Hi All

I want to build a form which conists of several sections. I would like to use radio buttons to selectively enable/disable these different sections. For example if the first radio button is clicked, all the form elements in that section are enabled and all the elements in the other sections become greyed out (disabled).

How can I do this? The following is a simple form and script I wrote. Can someone please tell me if I am on the right track? How does one enable/disable an object using JS?

Many thanks, Ben
--------------
FORM:

<form name="form1" method="post" action="">
<input type="radio" name="radiobutton" value="1" onclick="test(1); return false">
<select name="select">
</select>
<input type="radio" name="radiobutton" value="2" onclick="test(2);">
<input type="text" name="text">
</form>

---------------
SCRIPT:

function test (temp) {
switch (temp) {
case 1:
alert('One');
document.all.select.enable = true;
document.all.text.enable = false;
break;
case 2:
alert('Two');
document.all.select.enable = false;
document.all.text.enable = true;
break;
default:
alert('What to do?');
}
}