1.PNG2.PNG

<!DOCTYPE html >
<html >
<head>
    <title>form沒差</title>
    <script>
       function check1(){
        
       var radio1=document.getElementsByName("v1");
           radio2=document.getElementsByName("v2");
radio3=document.getElementsByName("v3");
radio4=document.getElementsByName("v4");
radio5=document.getElementsByName("v5");
radio6=document.getElementsByName("v6");
radio7=document.getElementsByName("v7");
radio8=document.getElementsByName("v8");
radio9=document.getElementsByName("v9");
radio10=document.getElementsByName("v10");

   for(var i=0;i<radio1.length;i++)
   {
         if(radio1.item(i).checked==true)
             {
flag1=1+i;
   for(var j=0;j<radio2.length;j++)

    if(radio2.item(j).checked==true)
             {
flag2=1+j;
for(var a=0;a<radio3.length;a++)

    if(radio3.item(a).checked==true)
             {
flag3=1+a;
for(var b=0;b<radio4.length;b++)

    if(radio4.item(b).checked==true)
             {
flag4=1+b;
for(var c=0;c<radio5.length;c++)

    if(radio5.item(c).checked==true)
             {
flag5=1+c;
for(var d=0;d<radio6.length;d++)

    if(radio6.item(d).checked==true)
             {
flag6=1+b;
for(var e=0;e<radio7.length;e++)

    if(radio7.item(e).checked==true)
             {
flag7=1+e;
for(var f=0;f<radio8.length;f++)

    if(radio8.item(f).checked==true)
             {
flag8=1+f;
for(var g=0;g<radio9.length;g++)

    if(radio9.item(g).checked==true)
             {
flag9=1+g;
for(var h=0;h<radio10.length;h++)

    if(radio10.item(h).checked==true)
             {
flag10=1+h;
            document.write(flag1,flag2,flag3,flag4,flag5,flag6,flag7,flag8,flag9,flag10);
            document.write("<br>");
            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 check1();" >
<h5>1、我能活多久?</h5>
<input name="v1" type="radio" value="1">300年             
<input name="v1" type="radio" value="2">400年               
<input name="v1" type="radio" value="3">1000年
</form>
<h5>2、陳2坤會不會寫程式?</h5>
<input name="v2" type="radio" value="1">會             
<input name="v2" type="radio" value="2">還好               
<input name="v2" type="radio" value="3">不會
</form>
<h5>3、陳3坤會不會寫程式?</h5>
<input name="v3" type="radio" value="1">會             
<input name="v3" type="radio" value="2">還好               
<input name="v3" type="radio" value="3">不會
</form>
<h5>4、陳4坤會不會寫程式?</h5>
<input name="v4" type="radio" value="1">會             
<input name="v4" type="radio" value="2">還好               
<input name="v4" type="radio" value="3">不會
</form>
<h5>5、陳5坤會不會寫程式?</h5>
<input name="v5" type="radio" value="1">會             
<input name="v5" type="radio" value="2">還好               
<input name="v5" type="radio" value="3">不會
</form>
<h5>6、陳6坤會不會寫程式?</h5>
<input name="v6" type="radio" value="1">會             
<input name="v6" type="radio" value="2">還好               
<input name="v6" type="radio" value="3">不會
</form>
<h5>7、陳7坤會不會寫程式?</h5>
<input name="v7" type="radio" value="1">會             
<input name="v7" type="radio" value="2">還好               
<input name="v7" type="radio" value="3">不會
</form>
<h5>8、陳8坤會不會寫程式?</h5>
<input name="v8" type="radio" value="1">會             
<input name="v8" type="radio" value="2">還好               
<input name="v8" type="radio" value="3">不會
</form>
<h5>9、陳9坤會不會寫程式?</h5>
<input name="v9" type="radio" value="1">會             
<input name="v9" type="radio" value="2">還好               
<input name="v9" type="radio" value="3">不會
</form>
<h5>10、陳10坤會不會寫程式?</h5>
<input name="v10" type="radio" value="1">會             
<input name="v10" type="radio" value="2">還好               
<input name="v10" type="radio" value="3">不會
</form>
    <button onclick="check1()" >=</button>
    <output id="result"></output>
</body>
</html>

arrow
arrow
    全站熱搜

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