猿问

表单响应计算

我只是为物理治疗师创建表格和表格。在计算“基于响应的总和”时需要您的帮助。极限难度值可以为“ 0”,没有难度可以为“ 4”


我熟悉阅读和修改js,html,css代码。这是我写的。


<FORM >

  <TABLE BORDER>

    <TR ALIGN=CENTER>

      <TD WIDTH=350><B>ACTIVITIES<B> </TD>

      <TD WIDTH=125><B>Extreme difficulty (0)</B></TD>

      <TD WIDTH=125><B>Quite a bit of difficulty (1)</B></TD>

      <TD WIDTH=125><B>Moderate Difficulty(2)</B></TD>

      <TD WIDTH=125><B>Little Difficulty(3)</B></TD>

      <TD WIDTH=125><B>No Difficulty(4)</B></TD>

    </TR>

    <TR ALIGN=CENTER>

      <TD  ALIGN=LEFT> Any of usual work (household, work)</TD>

      <TD><INPUT TYPE="RADIO" NAME="stimulat" VALUE="1"></TD>

      <TD><INPUT TYPE="RADIO" NAME="stimulat" VALUE="2"></TD>

      <TD><INPUT TYPE="RADIO" NAME="stimulat" VALUE="3"></TD>

      <TD><INPUT TYPE="RADIO" NAME="stimulat" VALUE="4"></TD>

      <TD><INPUT TYPE="RADIO" NAME="stimulat" VALUE="5"></TD>

    </TR>

    <TR ALIGN=CENTER>

      <TD  ALIGN=LEFT> Your hobbies, recreational, sporting</TD>

      <TD><INPUT TYPE="RADIO" NAME="freedom" VALUE="1"></TD>

      <TD><INPUT TYPE="RADIO" NAME="freedom" VALUE="2"></TD>

      <TD><INPUT TYPE="RADIO" NAME="freedom" VALUE="3"></TD>

      <TD><INPUT TYPE="RADIO" NAME="freedom" VALUE="4"></TD>

      <TD><INPUT TYPE="RADIO" NAME="freedom" VALUE="5"></TD>

    </TR>    

    <TR ALIGN=CENTER>

      <TD  ALIGN=LEFT> Lifting bag of groceries to waist level</TD>

      <TD><INPUT TYPE="RADIO" NAME="demand" VALUE="1"></TD>

      <TD><INPUT TYPE="RADIO" NAME="demand" VALUE="2"></TD>

      <TD><INPUT TYPE="RADIO" NAME="demand" VALUE="3"></TD>

      <TD><INPUT TYPE="RADIO" NAME="demand" VALUE="4"></TD>

      <TD><INPUT TYPE="RADIO" NAME="demand" VALUE="5"></TD>

    </TR>


我不知道如何计算此表格的结果值


杨魅力
浏览 152回答 3
3回答

繁华开满天机

<h4 style="text-align:center;color:blue;"> Dr ABC<br> MYLocation</h4><form action="" method="get">&nbsp; &nbsp; <b> Enter Patient's Name :</b> <input type="text"&nbsp; /><br></form><h4> We are interested in knowing wheather you are having any difficulty with the&nbsp;&nbsp;activities listed below <u> because of your upper limb problem </u>for which <br> you are seeking attention. Provide an answer for each activity</h4><h4> Today, <u>do you or would you </u> have any difficulty with: (check boxes below&nbsp;on each line)</h4><style>table, td { border: 1px solid grey }&nbsp; &nbsp; td {&nbsp; &nbsp; &nbsp; text-align: center;&nbsp; &nbsp; &nbsp; min-width: 125px;&nbsp; &nbsp; &nbsp; max-width: 125px;&nbsp; &nbsp; }&nbsp; &nbsp; tr td:first-child {&nbsp; &nbsp; &nbsp; text-align: left;&nbsp; &nbsp; &nbsp; min-width: 350px;&nbsp; &nbsp; &nbsp; max-width: 350px;&nbsp; &nbsp; }&nbsp; &nbsp; thead td { font-weight: bold }&nbsp; &nbsp; #the-Sum {&nbsp; &nbsp; &nbsp; display: block;&nbsp; &nbsp; &nbsp; margin: 10px 0 0 20px;&nbsp; &nbsp; &nbsp; font-weight: bold;&nbsp; &nbsp; &nbsp; color:crimson;}</style><form id="the-Form"><table><thead>&nbsp; <tr>&nbsp; &nbsp; <td>ACTIVITIES </td>&nbsp; &nbsp; <td>Extreme Difficulty or Unable to Perform Activity&nbsp;(0)</td>&nbsp; &nbsp; <td>Quite a Bit of Difficulty&nbsp;(1)</td>&nbsp; &nbsp; <td>Moderate Difficulty&nbsp;(2)</td>&nbsp; &nbsp; <td>A Little bit of Difficulty&nbsp;(3)</td>&nbsp; &nbsp; <td>No Difficulty&nbsp;(4)</td>&nbsp; </tr></thead><tbody>&nbsp; <tr>&nbsp; &nbsp; <td> Any of usual work, household, or school activities</td>&nbsp; &nbsp; <td><input type="radio" name="household" value="0"></td>&nbsp; &nbsp; <td><input type="radio" name="household" value="1"></td>&nbsp; &nbsp; <td><input type="radio" name="household" value="2"></td>&nbsp; &nbsp; <td><input type="radio" name="household" value="3"></td>&nbsp; &nbsp; <td><input type="radio" name="household" value="4"></td>&nbsp; </tr>&nbsp; <tr>&nbsp; &nbsp; <td> Your usual hobbies, recreational, sporting activities</td>&nbsp; &nbsp; <td><input type="radio" name="hobbies" value="0"></td>&nbsp; &nbsp; <td><input type="radio" name="hobbies" value="1"></td>&nbsp; &nbsp; <td><input type="radio" name="hobbies" value="2"></td>&nbsp; &nbsp; <td><input type="radio" name="hobbies" value="3"></td>&nbsp; &nbsp; <td><input type="radio" name="hobbies" value="4"></td>&nbsp; </tr>&nbsp; <tr>&nbsp; &nbsp; <td> Lifting bag of groceries to waist level</td>&nbsp; &nbsp; <td><input type="radio" name="groceryw" value="0"></td>&nbsp; &nbsp; <td><input type="radio" name="groceryw" value="1"></td>&nbsp; &nbsp; <td><input type="radio" name="groceryw" value="2"></td>&nbsp; &nbsp; <td><input type="radio" name="groceryw" value="3"></td>&nbsp; &nbsp; <td><input type="radio" name="groceryw" value="4"></td>&nbsp; </tr>&nbsp; <tr>&nbsp; &nbsp; <td> Lifting a bag of groceries above your head </td>&nbsp; &nbsp; <td><input type="radio" name="groceryd" value="0"></td>&nbsp; &nbsp; <td><input type="radio" name="groceryd" value="1"></td>&nbsp; &nbsp; <td><input type="radio" name="groceryd" value="2"></td>&nbsp; &nbsp; <td><input type="radio" name="groceryd" value="3"></td>&nbsp; &nbsp; <td><input type="radio" name="groceryd" value="4"></td>&nbsp; </tr>&nbsp; <tr>&nbsp; &nbsp; <td> Grooming your hair </td>&nbsp; &nbsp; <td><input type="radio" name="grooming" value="0"></td>&nbsp; &nbsp; <td><input type="radio" name="grooming" value="1"></td>&nbsp; &nbsp; <td><input type="radio" name="grooming" value="2"></td>&nbsp; &nbsp; <td><input type="radio" name="grooming" value="3"></td>&nbsp; &nbsp; <td><input type="radio" name="grooming" value="4"></td>&nbsp; </tr>&nbsp; <tr>&nbsp; &nbsp; <td> Pushing up on your hands (e.g. from bathtub or chair) </td>&nbsp; &nbsp; <td><input type="radio" name="pushing" value="0"></td>&nbsp; &nbsp; <td><input type="radio" name="pushing" value="1"></td>&nbsp; &nbsp; <td><input type="radio" name="pushing" value="2"></td>&nbsp; &nbsp; <td><input type="radio" name="pushing" value="3"></td>&nbsp; &nbsp; <td><input type="radio" name="pushing" value="4"></td>&nbsp; </tr>&nbsp; <tr>&nbsp; &nbsp; <td> Preparing food (e.g. peeling, cutting </td>&nbsp; &nbsp; <td><input type="radio" name="food" value="0"></td>&nbsp; &nbsp; <td><input type="radio" name="food" value="1"></td>&nbsp; &nbsp; <td><input type="radio" name="food" value="2"></td>&nbsp; &nbsp; <td><input type="radio" name="food" value="3"></td>&nbsp; &nbsp; <td><input type="radio" name="food" value="4"></td>&nbsp; </tr>&nbsp; <tr>&nbsp; &nbsp; <td> Driving </td>&nbsp; &nbsp; <td><input type="radio" name="driving" value="0"></td>&nbsp; &nbsp; <td><input type="radio" name="driving" value="1"></td>&nbsp; &nbsp; <td><input type="radio" name="driving" value="2"></td>&nbsp; &nbsp; <td><input type="radio" name="driving" value="3"></td>&nbsp; &nbsp; <td><input type="radio" name="driving" value="4"></td>&nbsp; </tr>&nbsp; <tr>&nbsp; &nbsp; <td> Vaccuming, sweeping, or raking </td>&nbsp; &nbsp; <td><input type="radio" name="cleaning" value="0"></td>&nbsp; &nbsp; <td><input type="radio" name="cleaning" value="1"></td>&nbsp; &nbsp; <td><input type="radio" name="cleaning" value="2"></td>&nbsp; &nbsp; <td><input type="radio" name="cleaning" value="3"></td>&nbsp; &nbsp; <td><input type="radio" name="cleaning" value="4"></td>&nbsp; </tr>&nbsp; <tr>&nbsp; &nbsp; <td> Dressing </td>&nbsp; &nbsp; <td><input type="radio" name="dressing" value="0"></td>&nbsp; &nbsp; <td><input type="radio" name="dressing" value="1"></td>&nbsp; &nbsp; <td><input type="radio" name="dressing" value="2"></td>&nbsp; &nbsp; <td><input type="radio" name="dressing" value="3"></td>&nbsp; &nbsp; <td><input type="radio" name="dressing" value="4"></td>&nbsp; </tr>&nbsp; <tr>&nbsp; &nbsp; <td> Doing up buttons </td>&nbsp; &nbsp; <td><input type="radio" name="dbuttons" value="0"></td>&nbsp; &nbsp; <td><input type="radio" name="dbuttons" value="1"></td>&nbsp; &nbsp; <td><input type="radio" name="dbuttons" value="2"></td>&nbsp; &nbsp; <td><input type="radio" name="dbuttons" value="3"></td>&nbsp; &nbsp; <td><input type="radio" name="dbuttons" value="4"></td>&nbsp; </tr>&nbsp; <tr>&nbsp; &nbsp; <td> Using tools or appliances</td>&nbsp; &nbsp; <td><input type="radio" name="appliance" value="0"></td>&nbsp; &nbsp; <td><input type="radio" name="appliance" value="1"></td>&nbsp; &nbsp; <td><input type="radio" name="appliance" value="2"></td>&nbsp; &nbsp; <td><input type="radio" name="appliance" value="3"></td>&nbsp; &nbsp; <td><input type="radio" name="appliance" value="4"></td>&nbsp; </tr>&nbsp; <tr>&nbsp; &nbsp; <td> Opening doors </td>&nbsp; &nbsp; <td><input type="radio" name="doors" value="0"></td>&nbsp; &nbsp; <td><input type="radio" name="doors" value="1"></td>&nbsp; &nbsp; <td><input type="radio" name="doors" value="2"></td>&nbsp; &nbsp; <td><input type="radio" name="doors" value="3"></td>&nbsp; &nbsp; <td><input type="radio" name="doors" value="4"></td>&nbsp; </tr>&nbsp; <tr>&nbsp; &nbsp; <td> Cleaning </td>&nbsp; &nbsp; <td><input type="radio" name="cleaning1" value="0"></td>&nbsp; &nbsp; <td><input type="radio" name="cleaning1" value="1"></td>&nbsp; &nbsp; <td><input type="radio" name="cleaning1" value="2"></td>&nbsp; &nbsp; <td><input type="radio" name="cleaning1" value="3"></td>&nbsp; &nbsp; <td><input type="radio" name="cleaning1" value="4"></td>&nbsp; </tr>&nbsp; <tr>&nbsp; &nbsp; <td> Tying or lacing shoes</td>&nbsp; &nbsp; <td><input type="radio" name="shoes" value="0"></td>&nbsp; &nbsp; <td><input type="radio" name="shoes" value="1"></td>&nbsp; &nbsp; <td><input type="radio" name="shoes" value="2"></td>&nbsp; &nbsp; <td><input type="radio" name="shoes" value="3"></td>&nbsp; &nbsp; <td><input type="radio" name="shoes" value="4"></td>&nbsp; </tr>&nbsp; <tr>&nbsp; &nbsp; <td> Sleeping</td>&nbsp; &nbsp; <td><input type="radio" name="sleep" value="0"></td>&nbsp; &nbsp; <td><input type="radio" name="sleep" value="1"></td>&nbsp; &nbsp; <td><input type="radio" name="sleep" value="2"></td>&nbsp; &nbsp; <td><input type="radio" name="sleep" value="3"></td>&nbsp; &nbsp; <td><input type="radio" name="sleep" value="4"></td>&nbsp; </tr>&nbsp; <tr>&nbsp; &nbsp; <td> Laundering cloths (e.g. washing, ironing, folding)</td>&nbsp; &nbsp; <td><input type="radio" name="laundry" value="0"></td>&nbsp; &nbsp; <td><input type="radio" name="laundry" value="1"></td>&nbsp; &nbsp; <td><input type="radio" name="laundry" value="2"></td>&nbsp; &nbsp; <td><input type="radio" name="laundry" value="3"></td>&nbsp; &nbsp; <td><input type="radio" name="laundry" value="4"></td>&nbsp; </tr>&nbsp; <tr>&nbsp; &nbsp; <td>Opening a jar</td>&nbsp; &nbsp; <td><input type="radio" name="jar" value="0"></td>&nbsp; &nbsp; <td><input type="radio" name="jar" value="1"></td>&nbsp; &nbsp; <td><input type="radio" name="jar" value="2"></td>&nbsp; &nbsp; <td><input type="radio" name="jar" value="3"></td>&nbsp; &nbsp; <td><input type="radio" name="jar" value="4"></td>&nbsp; </tr>&nbsp; <tr>&nbsp; &nbsp; <td> Throwing a ball </td>&nbsp; &nbsp; <td><input type="radio" name="ball" value="0"></td>&nbsp; &nbsp; <td><input type="radio" name="ball" value="1"></td>&nbsp; &nbsp; <td><input type="radio" name="ball" value="2"></td>&nbsp; &nbsp; <td><input type="radio" name="ball" value="3"></td>&nbsp; &nbsp; <td><input type="radio" name="ball" value="4"></td>&nbsp; </tr>&nbsp; <tr>&nbsp; &nbsp; <td> Carrying a small suitcase with affected limb </td>&nbsp; &nbsp; <td><input type="radio" name="carrying" value="0"></td>&nbsp; &nbsp; <td><input type="radio" name="carrying" value="1"></td>&nbsp; &nbsp; <td><input type="radio" name="carrying" value="2"></td>&nbsp; &nbsp; <td><input type="radio" name="carrying" value="3"></td>&nbsp; &nbsp; <td><input type="radio" name="carrying" value="4"></td>&nbsp; </tr></tbody></table><output id="the-Sum"> total = 0 </output></form><script>&nbsp; &nbsp; const&nbsp; theForm&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= document.querySelector('#the-Form'),&nbsp; theTotal&nbsp; &nbsp; &nbsp; &nbsp; = document.querySelector('#the-Sum'),&nbsp; List_RadioGroup = [ 'household', 'hobbies', 'groceryw', 'groceryd', 'grooming', 'pushing', 'food', 'driving', 'cleaning', 'dressing', 'dbuttons', 'appliance', 'doors', 'cleaning1', 'shoes', 'sleep', 'laundry', 'jar', 'ball', 'carrying']&nbsp; ;// load init.theTotal.textContent = ' total = 0 ';List_RadioGroup.forEach(xElm=>{ theForm[xElm][0].checked = true; })theForm.onchange = function(){&nbsp; let total = 0;&nbsp; List_RadioGroup.forEach(xElm=>{&nbsp; &nbsp; total += parseInt( document.querySelector(`input[name="${xElm}"]:checked`).value );&nbsp; })&nbsp; theTotal.textContent = ` TOTAL OUT OF 80 = ${total} `;}</script><div><form><input type="button" value="Print or Save as pdf" onClick="window.print()"></form></div>
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答