Not a Member Yet,
Click here to Register
How do you like the new design?






ID: 244
Viewed: 3741
Added: Jul 17, 2002
Version:
Snippet uploaded by: snippet
Written By: unknown
Demo: Sorry, no demo



User Rated at: 0 Stars
Rate This:

Thank you for your vote. Please wait...

It appears you already voted for this snippet

It appears your vote value was empty

a simple way to disable a group of radio buttons and enable another group.

Browsers: IE4+, NS6+, Opera, Mozilla 1.x

<!---Head--->
<script language=javascript>
function disableTwo(disable,enable){
var x;
x=0;
for ( x = 0; x <= (disable-1); x++ ) {
document.form1.radio2option[x].disabled="true";
}
document.form1.text2.disabled="true";
//enable one
x=0;
for ( x = 0; x <= (enable-1); x++ ) {
document.form1.radio1option[x].disabled="";
}
document.form1.text1.disabled="";

}

function disableOne(disable,enable){
var x;
x=0;
for ( x = 0; x <= (disable-1); x++ ) {
document.form1.radio1option[x].disabled="true";
}
document.form1.text1.disabled="true";
//enable two
x=0;
for ( x = 0; x <= (enable-1); x++ ) {
document.form1.radio2option[x].disabled="";
}
document.form1.text2.disabled="";

}

</script>

<!---Body--->


 <form name=form1>
<br><br><br>
<input type=radio name=radio1 value=radio1 onClick="disableTwo(4,7);" checked>Radio1
<br>   <input type=radio name=radio1option value=radio1option>
<br>   <input type=radio name=radio1option value=radio1option>
<br>   <input type=radio name=radio1option value=radio1option>
<br>   <input type=radio name=radio1option value=radio1option>
<br>   <input type=radio name=radio1option value=radio1option>
<br>   <input type=radio name=radio1option value=radio1option>
<br>   <input type=radio name=radio1option value=radio1option><input type=text size=10 name=text1 value=text1>
<br><br><br>

<input type=radio name=radio1 value=radio1 onclick="disableOne(7,4);">Radio1
<br>   <input type=radio name=radio2option value=radio2option>
<br>   <input type=radio name=radio2option value=radio2option>
<br>   <input type=radio name=radio2option value=radio2option>
<br>   <input type=radio name=radio2option value=radio2option>
<input type=text name=text2 size=10 value=text2>
</form>


No Comments to show

Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.


Replying to a Comment...


Adding your comment. Please wait...

Thanks for adding your comment!. After further review it will be added.

There was a problem adding your comment. Please try again.

Please complete all the fields in the form before sending.

© 2002 - 2017 snippetlibrary.com All Rights Reserved. Conditions