-1

我想做一个简单的测试,通过单选按钮提问和回答标记,但我被卡住了。

我有 6 个单独的测试,全部由 10 个问题组成,您将在代码中看到。我用10个问题做了两个测试,我的问题是让他们自己个性化,这样我就能得到不同的答案。

我想要的是当有人标记“是”然后他/她在测试结束时得到肯定答案或“是”答案的总和。

这是代码:

     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <script type="text/javascript">
        function DisplayPrice(price){
            var val1 = 0;
            for( i = 0; i < document.form1.price.length; i++ ){
                if( document.form1.price[i].checked == true ){
                    val1 = document.form1.price[i].value;
                }
            }

            var val2 = 0;
            for( i = 0; i < document.form2.price2.length; i++ ){
                if( document.form2.price2[i].checked == true ){
                    val2 = document.form2.price2[i].value;
                }
            }

            var val3 = 0;
            for( i = 0; i < document.form3.price3.length; i++ ){
                if( document.form3.price3[i].checked == true ){
                    val3 = document.form3.price3[i].value;
                }
            }

            var val4 = 0;
            for( i = 0; i < document.form4.price4.length; i++ ){
                if( document.form4.price4[i].checked == true ){
                    val4 = document.form4.price4[i].value;
                }
            }

            var val5 = 0;
            for( i = 0; i < document.form5.price5.length; i++ ){
                if( document.form5.price5[i].checked == true ){
                    val5 = document.form5.price5[i].value;
                }
            }

            var val6 = 0;
            for( i = 0; i < document.form6.price6.length; i++ ){
                if( document.form6.price6[i].checked == true ){
                    val6 = document.form6.price6[i].value;
                }
            }

            var val7 = 0;
            for( i = 0; i < document.form7.price7.length; i++ ){
                if( document.form7.price7[i].checked == true ){
                    val7 = document.form7.price7[i].value;
                }
            }

            var val8 = 0;
            for( i = 0; i < document.form8.price8.length; i++ ){
                if( document.form8.price8[i].checked == true ){
                    val8 = document.form8.price8[i].value;
                }
            }

            var val9 = 0;
            for( i = 0; i < document.form9.price9.length; i++ ){
                if( document.form9.price9[i].checked == true ){
                    val9 = document.form9.price9[i].value;
                }
            }

            var val10 = 0;
            for( i = 0; i < document.form10.price10.length; i++ ){
                if( document.form10.price10[i].checked == true ){
                    val10 = document.form10.price10[i].value;
                }
            }


            var sum=parseInt(val1) + parseInt(val2) + parseInt(val3) + parseInt(val4) + parseInt(val5) + parseInt(val6) + parseInt(val7) + parseInt(val8) + parseInt(val9) + parseInt(val10);
            document.getElementById('totalSum').value=sum;
        }
    </script>
<style type="text/css">
body,td,th {
    color: #03C;
}
body {
    background-color: #999;
    text-align: left;
}
</style>
</head>
<body>
<h2><strong>TEST 1</strong></h2>
<form name="form1" id="form1" runat="server">
  <h3><br>
    QUESTION1.
      <input id="rdo_1" type="radio" value="1" name="price" onClick="DisplayPrice(this.value);">
      YES
      <input id="rdo_2" type="radio" value="0" name="price" onClick="DisplayPrice(this.value);">
      NO<br>
    </h3>
</form>
    <form name="form2" id="form2" runat="server">
      <h3><br>
        QUESTION2.
        <input id="rdo_1" type="radio" value="1" name="price2" onClick="DisplayPrice(this.value);">
        YES
        <input id="rdo_2" type="radio" value="0" name="price2" onClick="DisplayPrice(this.value);">
        NO<br>
      </h3>
    </form>
<form name="form3" id="form3" runat="server">
  <h3><br>
    QUESTION3.
    <input id="rdo_1" type="radio" value="1" name="price3" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_2" type="radio" value="0" name="price3" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form4" id="form4" runat="server">
  <h3><br>
    QUESTION4.
    <input id="rdo_1" type="radio" value="1" name="price4" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_2" type="radio" value="0" name="price4" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form5" id="form5" runat="server">
  <h3><br>
    QUESTION5.
    <input id="rdo_1" type="radio" value="1" name="price5" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_2" type="radio" value="0" name="price5" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form6" id="form6" runat="server">
  <h3><br>
    QUESTION6.
    <input id="rdo_1" type="radio" value="1" name="price6" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_2" type="radio" value="0" name="price6" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form7" id="form7" runat="server">
  <h3>QUESTION7.
        <input id="rdo_1" type="radio" value="1" name="price7" onClick="DisplayPrice(this.value);">
        YES
        <input id="rdo_2" type="radio" value="0" name="price7" onClick="DisplayPrice(this.value);">
        NO<br>
    </h3>
</form>
<form name="form8" id="form8" runat="server">
  <h3><br>
    QUESTION8.
        <input id="rdo_1" type="radio" value="1" name="price8" onClick="DisplayPrice(this.value);">
        YES
        <input id="rdo_2" type="radio" value="0" name="price8" onClick="DisplayPrice(this.value);">
        NO<br>
  </h3>
</form>
<form name="form9" id="form9" runat="server">
  <h3><br>
    QUESTION9.
        <input id="rdo_1" type="radio" value="1" name="price9" onClick="DisplayPrice(this.value);">
        YES
        <input id="rdo_2" type="radio" value="0" name="price9" onClick="DisplayPrice(this.value);">
        NO<br>
  </h3>
</form>
<form name="form10" id="form10" runat="server">
  <h3>QUESTION10.
    <input id="rdo_1" type="radio" value="1" name="price10" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_2" type="radio" value="0" name="price10" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<p>&nbsp;</p>
<h2><strong>TEST 2</strong></h2>
<form name="form1" id="form11" runat="server">
  <h3><br>
    QUESTION1.
    <input id="rdo_3" type="radio" value="1" name="price" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form2" id="form12" runat="server">
  <h3><br>
    QUESTION2.
    <input id="rdo_3" type="radio" value="1" name="price2" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price2" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form3" id="form13" runat="server">
  <h3><br>
    QUESTION3.
    <input id="rdo_3" type="radio" value="1" name="price3" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price3" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form4" id="form14" runat="server">
  <h3><br>
    QUESTION4.
    <input id="rdo_3" type="radio" value="1" name="price4" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price4" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form5" id="form15" runat="server">
  <h3><br>
    QUESTION5.
    <input id="rdo_3" type="radio" value="1" name="price5" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price5" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form6" id="form16" runat="server">
  <h3><br>
    QUESTION6.
    <input id="rdo_3" type="radio" value="1" name="price6" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price6" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form7" id="form17" runat="server">
  <h3>QUESTION7.
    <input id="rdo_3" type="radio" value="1" name="price7" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price7" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form8" id="form18" runat="server">
  <h3><br>
    QUESTION8.
    <input id="rdo_3" type="radio" value="1" name="price8" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price8" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form9" id="form19" runat="server">
  <h3><br>
    QUESTION9.
    <input id="rdo_3" type="radio" value="1" name="price9" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price9" onClick="DisplayPrice(this.value);">
    NO <br>
  </h3>
</form>
<form name="form10" id="form20" runat="server">
  <h3><br>
    QUESTION10.
    <input id="rdo_3" type="radio" value="1" name="price10" onClick="DisplayPrice(this.value);">
    DA
    <input id="rdo_4" type="radio" value="0" name="price10" onClick="DisplayPrice(this.value);">
    NE<br>
  </h3>
</form>
<h2>Score &quot;TEST1&quot;
  <input type="text" name="totalSum" id="totalSum" value="" size="3" readonly="readonly">
</h2>
<h2>Score &quot;TEST2&quot;
  <input type="text" name="totalSum2" id="totalSum2" value="" size="3" readonly="readonly">
</h2>
</body>
4

2 回答 2

0

我已经编辑了您的javascript以使其在 Google Chrome 中运行。我概括了您引用表单元素的方式。

function DisplayPrice(price){

        var mysum=0, mysum2 =0, mysm3=0, mysum4=0, num, ele, frm,f,e;

        for(f in document.forms)
        {
            frm = document.forms[f];
            for(e in frm.elements)
            {
                ele = frm.elements[e];
                if (ele.checked && ele.value)
                {
                    // based on ID we decide if TEST1 or TEST2 is counting
                    num = parseInt(frm.id.substr(4),10);
                    if (num < 11) {
                           mysum = mysum + parseInt(ele.value,10);
                    } else if (num < 21) {
                           mysum2 = mysum2 + parseInt(ele.value,10);
                    } else if (num < 31 ) {
                           mysum3 = mysum3 + parseInt(ele.value,10);
                    } else {
                           mysum4 = mysum4 + parseInt(ele.value,10);
                    }
                }
            }
        }

        document.getElementById('totalSum').value=mysum;
        document.getElementById('totalSum2').value=mysum2;
        document.getElementById('totalSum3').value=mysum3;
        document.getElementById('totalSum4').value=mysum4;

    }

为大家提供一个有效的JSFiddle来测试这些东西。

于 2013-02-20T20:49:10.300 回答
0

编辑:这是新代码...:/

 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <script type="text/javascript">
        function DisplayPrice(price){

            var mysum=0, mysum2 =0, mysum3 =0, mysum4 =0, num, ele, frm,f,e;

            for(f in document.forms)
            {
                frm = document.forms[f];
                for(e in frm.elements)
                {
                    ele = frm.elements[e];
                    if (ele.checked && ele.value)
                    {
                        num = parseInt(frm.id.substr(4),10);
                        if (num < 11) {
                               mysum = mysum + parseInt(ele.value,10);
                        } else {
                               mysum2 = mysum2 + parseInt(ele.value,10);
                        if (num < 21) {
                               mysum3 = mysum3 + parseInt(ele.value,10);
                        } else {
                               mysum4 = mysum4 + parseInt(ele.value,10);
                        }


                         }
                    }
                }
            }

            document.getElementById('totalSum').value=mysum;
            document.getElementById('totalSum2').value=mysum2;
            document.getElementById('totalSum3').value=mysum3;
            document.getElementById('totalSum4').value=mysum4;
        }

window.DisplayPrice=DisplayPrice;
    </script>
<style type="text/css">
body,td,th {
    color: #03C;
}
body {
    background-color: #999;
    text-align: left;
}
</style>
</head>
<body>
 <h2><strong>TEST 1</strong></h2>
<form name="form1" id="form1" runat="server">
  <h3><br>
    QUESTION1.
      <input id="rdo_1" type="radio" value="1" name="price" onClick="DisplayPrice(this.value)">
      YES
      <input id="rdo_2" type="radio" value="0" name="price" onClick="DisplayPrice(this.value);">
      NO<br>
    </h3>
</form>
    <form name="form2" id="form2" runat="server">
      <h3><br>
        QUESTION2.
        <input id="rdo_1" type="radio" value="1" name="price2" onClick="DisplayPrice(this.value);">
        YES
        <input id="rdo_2" type="radio" value="0" name="price2" onClick="DisplayPrice(this.value);">
        NO<br>
      </h3>
    </form>
<form name="form3" id="form3" runat="server">
  <h3><br>
    QUESTION3.
    <input id="rdo_1" type="radio" value="1" name="price3" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_2" type="radio" value="0" name="price3" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form4" id="form4" runat="server">
  <h3><br>
    QUESTION4.
    <input id="rdo_1" type="radio" value="1" name="price4" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_2" type="radio" value="0" name="price4" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form5" id="form5" runat="server">
  <h3><br>
    QUESTION5.
    <input id="rdo_1" type="radio" value="1" name="price5" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_2" type="radio" value="0" name="price5" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form6" id="form6" runat="server">
  <h3><br>
    QUESTION6.
    <input id="rdo_1" type="radio" value="1" name="price6" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_2" type="radio" value="0" name="price6" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form7" id="form7" runat="server">
  <h3>QUESTION7.
        <input id="rdo_1" type="radio" value="1" name="price7" onClick="DisplayPrice(this.value);">
        YES
        <input id="rdo_2" type="radio" value="0" name="price7" onClick="DisplayPrice(this.value);">
        NO<br>
    </h3>
</form>
<form name="form8" id="form8" runat="server">
  <h3><br>
    QUESTION8.
        <input id="rdo_1" type="radio" value="1" name="price8" onClick="DisplayPrice(this.value);">
        YES
        <input id="rdo_2" type="radio" value="0" name="price8" onClick="DisplayPrice(this.value);">
        NO<br>
  </h3>
</form>
<form name="form9" id="form9" runat="server">
  <h3><br>
    QUESTION9.
        <input id="rdo_1" type="radio" value="1" name="price9" onClick="DisplayPrice(this.value);">
        YES
        <input id="rdo_2" type="radio" value="0" name="price9" onClick="DisplayPrice(this.value);">
        NO<br>
  </h3>
</form>
<form name="form10" id="form10" runat="server">
  <h3>QUESTION10.
    <input id="rdo_1" type="radio" value="1" name="price10" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_2" type="radio" value="0" name="price10" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<p>&nbsp;</p>
<h2><strong>TEST 2</strong></h2>
<form name="form1" id="form11" runat="server">
  <h3><br>
    QUESTION1.
    <input id="rdo_3" type="radio" value="1" name="price" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form2" id="form12" runat="server">
  <h3><br>
    QUESTION2.
    <input id="rdo_3" type="radio" value="1" name="price2" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price2" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form3" id="form13" runat="server">
  <h3><br>
    QUESTION3.
    <input id="rdo_3" type="radio" value="1" name="price3" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price3" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form4" id="form14" runat="server">
  <h3><br>
    QUESTION4.
    <input id="rdo_3" type="radio" value="1" name="price4" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price4" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form5" id="form15" runat="server">
  <h3><br>
    QUESTION5.
    <input id="rdo_3" type="radio" value="1" name="price5" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price5" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form6" id="form16" runat="server">
  <h3><br>
    QUESTION6.
    <input id="rdo_3" type="radio" value="1" name="price6" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price6" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form7" id="form17" runat="server">
  <h3>QUESTION7.
    <input id="rdo_3" type="radio" value="1" name="price7" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price7" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form8" id="form18" runat="server">
  <h3><br>
    QUESTION8.
    <input id="rdo_3" type="radio" value="1" name="price8" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price8" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form9" id="form19" runat="server">
  <h3><br>
    QUESTION9.
    <input id="rdo_3" type="radio" value="1" name="price9" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price9" onClick="DisplayPrice(this.value);">
    NO <br>
  </h3>
</form>
<form name="form10" id="form20" runat="server">
  <h3><br>
    QUESTION10.
    <input id="rdo_3" type="radio" value="1" name="price10" onClick="DisplayPrice(this.value);">
    DA
    <input id="rdo_4" type="radio" value="0" name="price10" onClick="DisplayPrice(this.value);">
    NE<br>
  </h3>
</form>
<h2><strong>TEST 3</strong></h2>
<form name="form1" id="form21" runat="server">
  <h3><br>
    QUESTION1.
    <input id="rdo_3" type="radio" value="1" name="price" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form2" id="form22" runat="server">
  <h3><br>
    QUESTION2.
    <input id="rdo_3" type="radio" value="1" name="price2" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price2" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form3" id="form23" runat="server">
  <h3><br>
    QUESTION3.
    <input id="rdo_3" type="radio" value="1" name="price3" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price3" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form4" id="form24" runat="server">
  <h3><br>
    QUESTION4.
    <input id="rdo_3" type="radio" value="1" name="price4" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price4" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form5" id="form25" runat="server">
  <h3><br>
    QUESTION5.
    <input id="rdo_3" type="radio" value="1" name="price5" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price5" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form6" id="form26" runat="server">
  <h3><br>
    QUESTION6.
    <input id="rdo_3" type="radio" value="1" name="price6" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price6" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form7" id="form27" runat="server">
  <h3>QUESTION7.
    <input id="rdo_3" type="radio" value="1" name="price7" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price7" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form8" id="form28" runat="server">
  <h3><br>
    QUESTION8.
    <input id="rdo_3" type="radio" value="1" name="price8" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price8" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form9" id="form29" runat="server">
  <h3><br>
    QUESTION9.
    <input id="rdo_3" type="radio" value="1" name="price9" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price9" onClick="DisplayPrice(this.value);">
    NO <br>
  </h3>
</form>
<form name="form10" id="form30" runat="server">
  <h3><br>
    QUESTION10.
    <input id="rdo_3" type="radio" value="1" name="price10" onClick="DisplayPrice(this.value);">
    DA
    <input id="rdo_4" type="radio" value="0" name="price10" onClick="DisplayPrice(this.value);">
    NE<br>
  </h3>
</form>
<h2><strong>TEST 4</strong></h2>
<form name="form1" id="form31" runat="server">
  <h3><br>
    QUESTION1.
    <input id="rdo_3" type="radio" value="1" name="price" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form2" id="form32" runat="server">
  <h3><br>
    QUESTION2.
    <input id="rdo_3" type="radio" value="1" name="price2" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price2" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form3" id="form33" runat="server">
  <h3><br>
    QUESTION3.
    <input id="rdo_3" type="radio" value="1" name="price3" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price3" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form4" id="form34" runat="server">
  <h3><br>
    QUESTION4.
    <input id="rdo_3" type="radio" value="1" name="price4" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price4" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form5" id="form35" runat="server">
  <h3><br>
    QUESTION5.
    <input id="rdo_3" type="radio" value="1" name="price5" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price5" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form6" id="form36" runat="server">
  <h3><br>
    QUESTION6.
    <input id="rdo_3" type="radio" value="1" name="price6" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price6" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form7" id="form37" runat="server">
  <h3>QUESTION7.
    <input id="rdo_3" type="radio" value="1" name="price7" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price7" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form8" id="form38" runat="server">
  <h3><br>
    QUESTION8.
    <input id="rdo_3" type="radio" value="1" name="price8" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price8" onClick="DisplayPrice(this.value);">
    NO<br>
  </h3>
</form>
<form name="form9" id="form39" runat="server">
  <h3><br>
    QUESTION9.
    <input id="rdo_3" type="radio" value="1" name="price9" onClick="DisplayPrice(this.value);">
    YES
    <input id="rdo_4" type="radio" value="0" name="price9" onClick="DisplayPrice(this.value);">
    NO <br>
  </h3>
</form>
<form name="form10" id="form40" runat="server">
  <h3><br>
    QUESTION10.
    <input id="rdo_3" type="radio" value="1" name="price10" onClick="DisplayPrice(this.value);">
    DA
    <input id="rdo_4" type="radio" value="0" name="price10" onClick="DisplayPrice(this.value);">
    NE<br>
  </h3>
</form>
<h2>Score &quot;TEST1&quot;
  <input type="text" name="totalSum" id="totalSum" value="" size="3" readonly="readonly">
</h2>
<h2>Score &quot;TEST2&quot;
  <input type="text" name="totalSum2" id="totalSum2" value="" size="3" readonly="readonly">
</h2>
<h2>Score &quot;TEST3&quot;
  <input type="text" name="totalSum3" id="totalSum3" value="" size="3" readonly="readonly">
</h2>
<h2>Score &quot;TEST3&quot;
  <input type="text" name="totalSum4" id="totalSum4" value="" size="3" readonly="readonly">
</h2>
</body>
于 2013-02-22T19:47:25.500 回答