未命名.png

<html>
<head>

<title>
From
</title>
<script>
function check(){

var radio1=document.getElementsByName("v1");
   for(var i=0;i<radio1.length;i++)
   {
         if(radio1.item(i).checked==true)
             {
     flag1=1;
alert(radio1.item(i).value);
                  break;
       }
   }

</script>
</head>
<body>

<form action="post.php" method="post"  name="add" enctype="multipart/form-data" onSubmit="return check();" >
<h1>1、ssss?</h1>
<input name="a" type="radio" value="1">1
<input name="a" type="radio" value="2">2
<input name="a" type="radio" value="3">3
<input type="button" value="submit" onclick="check()" />

</form>

</body>
</html>

 

未命名2.png未命名1.png

<html>
<head>
<title>
  Porm
</title>
<script>
function check1(){
var radio1=document.getElementsByName("v1");
var radio2=document.getElementsByName("v2");
var radio3=document.getElementsByName("v3");
var radio4=document.getElementsByName("v4");
var radio5=document.getElementsByName("v5");
var radio6=document.getElementsByName("v6");
var radio7=document.getElementsByName("v7");
var radio8=document.getElementsByName("v8");
var radio9=document.getElementsByName("v9");
var radio10=document.getElementsByName("v10");
   for(var i=0;i<radio1.length;i++){
         if(radio1.item(i).checked==true){
        flag1=1+i; 
        break;
       }
   }
   for(var i=0;i<radio2.length;i++){
         if(radio2.item(i).checked==true){
        flag2=1+i;
                break;
       }
   }
for(var i=0;i<radio3.length;i++){
         if(radio3.item(i).checked==true){
        flag3=1+i;
                break;
       }
   }
for(var i=0;i<radio4.length;i++){
         if(radio4.item(i).checked==true){
        flag4=1+i;
                break;
       }
   }
for(var i=0;i<radio5.length;i++){
         if(radio5.item(i).checked==true){
        flag5=1+i;
                break;
       }
   }
for(var i=0;i<radio6.length;i++){
         if(radio6.item(i).checked==true){
        flag6=1+i;
                break;
       }
   }
for(var i=0;i<radio7.length;i++){
         if(radio7.item(i).checked==true){
        flag7=1+i;
                break;
       }
   }
for(var i=0;i<radio8.length;i++){
         if(radio8.item(i).checked==true){
        flag8=1+i;
                break;
       }
   }
for(var i=0;i<radio9.length;i++){
         if(radio9.item(i).checked==true){
        flag9=1+i;
                break;
       }
   }
for(var i=0;i<radio10.length;i++){
         if(radio10.item(i).checked==true){
        flag10=1+i;
                break;
       }
   }

document.write(flag1,flag2,flag3,flag4,flag5,flag6,flag7,flag8,flag9,flag10)
document.write(flag1+flag2+flag3+flag4+flag5+flag6+flag7+flag8+flag9+flag10)

}
</script>
</head>
<body>
<form action="post.php" method="post"  name="add" enctype="multipart/form-data"onSubmit="return check();" >
<h1>1、ssss?</h1>
<input name="v1" type="radio" value="a">1
<input name="v1" type="radio" value="b">2
<input name="v1" type="radio" value="c">3
</form>
<form action="post.php" method="post"  name="add" enctype="multipart/form-data"onSubmit="return check();" >
<h1>2、ssss?</h1>
<input name="v2" type="radio" value="a">1
<input name="v2" type="radio" value="b">2
<input name="v2" type="radio" value="c">3
</form>
<form action="post.php" method="post"  name="add" enctype="multipart/form-data"onSubmit="return check();" >
<h1>3、ssss?</h1>
<input name="v3" type="radio" value="a">1
<input name="v3" type="radio" value="b">2
<input name="v3" type="radio" value="c">3
</form>
<form action="post.php" method="post"  name="add" enctype="multipart/form-data"onSubmit="return check();" >
<h1>4、ssss?</h1>
<input name="v4" type="radio" value="a">1
<input name="v4" type="radio" value="b">2
<input name="v4" type="radio" value="c">3
</form>
<form action="post.php" method="post"  name="add" enctype="multipart/form-data"onSubmit="return check();" >
<h1>5、ssss?</h1>
<input name="v5" type="radio" value="a">1
<input name="v5" type="radio" value="b">2
<input name="v5" type="radio" value="c">3
</form>
<form action="post.php" method="post"  name="add" enctype="multipart/form-data"onSubmit="return check();" >
<h1>6、ssss?</h1>
<input name="v6" type="radio" value="a">1
<input name="v6" type="radio" value="b">2
<input name="v6" type="radio" value="c">3
</form>
<form action="post.php" method="post"  name="add" enctype="multipart/form-data"onSubmit="return check();" >
<h1>7、ssss?</h1>
<input name="v7" type="radio" value="a">1
<input name="v7" type="radio" value="b">2
<input name="v7" type="radio" value="c">3
</form>
<form action="post.php" method="post"  name="add" enctype="multipart/form-data"onSubmit="return check();" >
<h1>8、ssss?</h1>
<input name="v8" type="radio" value="a">1
<input name="v8" type="radio" value="b">2
<input name="v8" type="radio" value="c">3
</form>
<form action="post.php" method="post"  name="add" enctype="multipart/form-data"onSubmit="return check();" >
<h1>9、ssss?</h1>
<input name="v9" type="radio" value="a">1
<input name="v9" type="radio" value="b">2
<input name="v9" type="radio" value="c">3
</form>
<form action="post.php" method="post"  name="add" enctype="multipart/form-data"onSubmit="return check();" >
<h1>10、ssss?</h1>
<input name="v10" type="radio" value="a">1
<input name="v10" type="radio" value="b">2
<input name="v10" type="radio" value="c">3
<input type="button" value="submit" onclick="check1()" />
</form>
</body>
</html>

arrow
arrow
    全站熱搜

    zxc1234567890666 發表在 痞客邦 留言(0) 人氣()