Hi,
The page has multipule radio groups and if one of the radio button in the group is clicked to "Yes" then all the "No" needs to be checked for the selected id, but not the clicked indexed id;
Below is the code, may be i am clear with my question
Thank you,
Venu
The page has multipule radio groups and if one of the radio button in the group is clicked to "Yes" then all the "No" needs to be checked for the selected id, but not the clicked indexed id;
Below is the code, may be i am clear with my question
Code:
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
function test(id, idx){
var array = document.all.namedItem(id);
alert(" Id Name is : " + id + "\n Selected Index of the id is : " + idx + "\n Length of array is : " + array.length);
for(var i=0; i < array.length; i++){
var obj = array[i];
if(idx != i){
if(obj.type == 'radio'){
obj.checked = true;
}
}
}
}
//-->
</SCRIPT>
<BODY>
<FORM METHOD=POST ACTION="">
1<INPUT TYPE="radio" NAME="1" value="Y" onClick="test('one', '0')" id="one"> Yes
<INPUT TYPE="radio" NAME="1" value="N" onClick="test('one', '0')" id="one"> No
<BR>
1<INPUT TYPE="radio" NAME="2" value="Y" onClick="test('one', '1')" id="one"> Yes
<INPUT TYPE="radio" NAME="2" value="N" onClick="test('one', '1')" id="one"> No
<BR>
3<INPUT TYPE="radio" NAME="3" value="Y" onClick="test('three', '2')" id="three"> Yes
<INPUT TYPE="radio" NAME="3" value="N" onClick="test('three', '2')" id="three"> No
<BR>
1<INPUT TYPE="radio" NAME="4" value="Y" onClick="test('one', '3')" id="one"> Yes
<INPUT TYPE="radio" NAME="4" value="N" onClick="test('one', '3')" id="one"> No
<BR>
1<INPUT TYPE="radio" NAME="5" value="Y" onClick="test('one', '4')" id="one"> Yes
<INPUT TYPE="radio" NAME="5" value="N" onClick="test('one', '4')" id="one"> No
<BR>
3<INPUT TYPE="radio" NAME="6" value="Y" onClick="test('three', '5')" id="three"> Yes
<INPUT TYPE="radio" NAME="6" value="N" onClick="test('three', '5')" id="three"> No
<BR>
</FORM>
</BODY>
</HTML>
Thank you,
Venu