1 <form name='form1' method='post'>
2 <input type='radio' name='g1' value='1'>value1
3 <input type='radio' name='g1' value='0'>value0
4 <input type='button' name='submit' value='Click' onclick='mysubmit(this.form)'>
5 </form>
6 <script language='javascript'>
7 function mysubmit(form) {
8 var rad = form.g1;
9 var len =rad.length ;
10 var rad_values = new Array(len) ;
11 for (i=0; i<len;i++){
12 rad_values[i]=rad[i].value;
13 if(rad[i].checked){
14 sel_value = rad_values[i];
15 alert(sel_value);
16 }
17 }
18 alert(rad.length);
19 alert(rad_values);
20
21 }
22 </script>
2 <input type='radio' name='g1' value='1'>value1
3 <input type='radio' name='g1' value='0'>value0
4 <input type='button' name='submit' value='Click' onclick='mysubmit(this.form)'>
5 </form>
6 <script language='javascript'>
7 function mysubmit(form) {
8 var rad = form.g1;
9 var len =rad.length ;
10 var rad_values = new Array(len) ;
11 for (i=0; i<len;i++){
12 rad_values[i]=rad[i].value;
13 if(rad[i].checked){
14 sel_value = rad_values[i];
15 alert(sel_value);
16 }
17 }
18 alert(rad.length);
19 alert(rad_values);
20
21 }
22 </script>