Web Analytics Made Easy -
StatCounter Help update quiz code Full code included - CodingForum

Announcement

Collapse
No announcement yet.

Help update quiz code Full code included

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help update quiz code Full code included

    Here is my full old quiz code, i would like to see if i could update 2 things im having difficults with.

    1 I would like to change the drop down boxes to radiogroups 1-5 values 0-4, eg never = 1 point, sometimes=2 points etc.
    i have tried using dreamveaver but for what ever reason it will not add up?
    2. the score at thee bottom should out put 1 of three options say 1-3 points not so good, 4-6 reasonable blah and 7+ something else i have tried to use an if statement but my csript language is poor to say the least.

    my working code is here it is essential that each answer has a different points value......

    <html>

    <head>

    <meta name="description" content="Rate yourself on the skills and traits needed to successfully represent yourself ">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta name="GENERATOR" content="Microsoft FrontPage 6.0">
    <title>Divorce Skills and Traits Quiz</title>

    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function AddItUp(form) {
    var item, firstValue, secondValue, thirdValue, fourthValue, fifthValue, sixthValue, seventhValue, eighthValue,
    ninthValue

    // Get the value of the item that's selected in the first list
    item = form.first.selectedIndex;
    firstValue = eval(form.first.options[item].value)

    // Get the value of the item that's selected in the second list
    item = form.second.selectedIndex;
    secondValue = eval(form.second.options[item].value)

    // Get the value of the item that's selected in the third list
    item = form.third.selectedIndex;
    thirdValue = eval(form.third.options[item].value)

    // Get the value of the item that's selected in the fourth list
    item = form.fourth.selectedIndex;
    fourthValue = eval(form.fourth.options[item].value)


    // Get the value of the item that's selected in the fifth list
    item = form.fifth.selectedIndex;
    fifthValue = eval(form.fifth.options[item].value)

    // Get the value of the item that's selected in the sixth list
    item = form.sixth.selectedIndex;
    sixthValue = eval(form.sixth.options[item].value)

    // Get the value of the item that's selected in the seventh list
    item = form.seventh.selectedIndex;
    seventhValue = eval(form.seventh.options[item].value)

    // Get the value of the item that's selected in the eighth list
    item = form.eighth.selectedIndex;
    eighthValue = eval(form.eighth.options[item].value)


    // Get the value of the item that's selected in the ninth list
    item = form.ninth.selectedIndex;
    ninthValue = eval(form.ninth.options[item].value)


    // Add up the value and display the total
    form.total.value = firstValue + secondValue + thirdValue + fourthValue + fifthValue + sixthValue + seventhValue + eighthValue + ninthValue

    }
    //-->
    </SCRIPT>

    </head>

    <body>

    <p align="right"><font face="Arial" size="1"><!--webbot
    bot="Timestamp" endspan i-checksum="12952" -->
    </font></p>

    <!--webbot bot="Include" U-Include="../../admin/fam-header-bar.html" TAG="BODY" startspan -->
    <!--webbot bot="Include" endspan i-checksum="45123" -->
    <FORM>

    <p style="margin-bottom: 0"><font face="Arial" size="2"><a name="q1"><b>1. Can you stick to deadlines (no matter what)?&nbsp;<br>
    <br>
    </b></a></font></p>
    <table border="1" width="100%">
    <tr>
    <td width="17%"><font face="Arial" size="2">
    <SELECT NAME="first">
    <OPTION VALUE=1>Yes
    <OPTION VALUE=0>No
    </SELECT>
    <label></label>
    </font>
    <p>
    <label></label>
    <br>
    </p></td>
    <td width="83%">


    <p>


    <font face="Arial">
    <b>


    <font SIZE="2">
    Yes</font>


    </b>
    <font SIZE="2">
    - <i>1 point</i> -The court will expect nothing less.<b><br>
    No</b> - <i>0 points</i> -</font></font><font face="Arial" size="2">You will need to be careful.<br>
    </font>


    <font face="Arial" size="1"><a href="#calc"></a></font>


    </p>


    </td>
    </tr>
    </table>
    <p><font face="Arial" size="2"><b>2<a name="q2">. Are you looking to “get even”?</a></b></font></p>
    <table border="1" width="100%">
    <tr>
    <td width="17%"><font face="Arial" size="2">
    <SELECT NAME="second">
    <OPTION VALUE=0>Yes
    <OPTION VALUE=1>No
    </SELECT></font></td>
    <td width="83%"><font face="Arial" SIZE="2">
    <b>Yes</b> - <i>0 points </i>- Div<br>
    <b>No</b> - <i>1 Point</i><br>
    </font>


    <font face="Arial" size="1"><a href="#calc"></a></font>


    </td>
    </tr>
    </table>

    <p><font face="Arial" size="2"><a name="q3">&nbsp;<b>3. Can you find the time to get to the courthouse during the day?&nbsp;</b></a></font></p>
    <table border="1" width="100%">
    <tr>
    <td width="17%"><font face="Arial" size="2"><SELECT NAME="third">
    <OPTION VALUE=1>Yes
    <OPTION VALUE=0>No

    </SELECT>&nbsp;&nbsp;</font></td>
    <td width="83%">
    <p>


    <font face="Arial" SIZE="2">
    <b>Yes</b> - <i>1 point</i>- A<b><br>
    No</b> - <i>0 points</i> - Y<br>
    </font>



    <font face="Arial" size="1"><a href="#calc"></a></font>


    </p>
    </td>
    </tr>
    </table>
    <p><font face="Arial" size="2">
    &nbsp;<a name="q4"><b>4. Do you find yourself yelling at your spouse whenever the topic of money, the kids, or joint decisions come up?&nbsp;</b></a>
    </font></p>

    <table border="1" width="100%">
    <tr>
    <td width="17%"><font face="Arial" size="2"><SELECT NAME="fourth">
    <OPTION VALUE=0>Yes

    <OPTION VALUE=1>No

    </SELECT>&nbsp;&nbsp;</font></td>
    <td width="83%">
    <p>


    <font face="Arial" SIZE="2">
    <b>Yes</b> – <i>0 points</i> - <b><br>
    No</b> - <i>1 point</i> - A.<br>
    </font>


    <font face="Arial" size="1"><a href="#calc"></a></font>


    </p>
    </td>
    </tr>
    </table>

    <p><font face="Arial" size="2"><a name="q5"><b>5. Is your spouse experienced at hiding income or assets?&nbsp;</b></a></font>
    </p>
    <table border="1" width="100%">
    <tr>
    <td width="17%"><font face="Arial" size="2">&nbsp;<SELECT NAME="fifth">
    <OPTION VALUE=0>Yes

    <OPTION VALUE=1>No


    </SELECT>&nbsp;&nbsp;</font></td>
    <td width="83%">


    <font face="Arial" SIZE="2">
    <b>Yes</b> - <i>0 points</i>.&nbsp;<br>
    <b>No</b> - <i>1 point</i><br>
    </font>


    <font face="Arial" size="1"><a href="#calc"></a></font>


    </td>
    </tr>
    </table>
    <p><font face="Arial" size="2"><a name="q6"><b>6. Was there physical or emotional abuse in your marriage?&nbsp;</b></a></font>
    </p>

    <table border="1" width="100%">
    <tr>
    <td width="17%"><font face="Arial" size="2">
    <SELECT NAME="sixth">
    <OPTION VALUE=0>Yes
    <OPTION VALUE=1>No
    </SELECT>&nbsp;&nbsp;</font></td>
    <td width="83%"><font face="Arial" SIZE="2"><b>Yes</b> - <i>0 points</i> - &nbsp;<br>
    <b>No</b> - <i>1 point</i><br>
    </font>


    <font face="Arial" size="1"><a href="#calc"></a></font>


    </td>
    </tr>
    </table>
    <p>

    <font face="Arial" size="2"><a name="q7"><b>7. Does the following describe you?&nbsp;</b></a></font>
    </p>
    <table border="1" width="100%">
    <tr>
    <td width="17%"><font face="Arial" size="2">
    <SELECT NAME="seventh">
    <OPTION VALUE=1>Yes *
    <OPTION VALUE=0>No


    </SELECT>&nbsp;&nbsp;</font></td>
    <td width="83%"><p align="left"><font face="Arial" size="2"><b>No</b> - <i>0 points</i> - <b><br>
    Yes</b> - <i>1point</i> - <br>
    </font><font face="Arial" size="1"><a href="#calc"></a></font></td>
    </tr>
    </table>

    <p><font face="Arial" size="2"><a name="q8"><b>8. Can you make decisions and stick with them?&nbsp;</b></a></font>
    </p>

    <table border="1" width="100%">
    <tr>
    <td width="17%"><font face="Arial" size="2">
    <SELECT NAME="eighth">

    <OPTION VALUE=1>Yes
    <OPTION VALUE=0>No

    </SELECT>&nbsp;&nbsp;</font></td>
    <td width="83%">


    <font face="Arial" size="2"><b>Yes</b> - <i>1 point</i>
    <b><br>
    No</b> - <i>0 points</i> -&nbsp;.<br>
    </font>


    <font face="Arial" size="1"><a href="#calc"></a></font>


    </td>
    </tr>
    </table>

    <p><font face="Arial" size="2"><a name="q9"><b>9. Can you live with some mistakes?</b>&nbsp;</a></font>
    </p>
    <table border="1" width="100%">
    <tr>
    <td width="17%"><font face="Arial" size="2">
    <SELECT NAME="ninth">
    <OPTION VALUE=1>Yes *

    <OPTION VALUE=0>No

    </SELECT>&nbsp;</font></td>
    <td width="83%">
    <p>


    <font face="Arial" SIZE="2">
    <b>Yes</b> - <i>1point</i> - <br>
    <b>No</b> - <i>0 points</i> - <br>
    </font>


    <font face="Arial" size="1"><a href="#calc"></a></font>


    </p>
    </td>
    </tr>
    </table>
    <hr>
    <p align="center"><font size="3" face="Arial"><b>Results</b></font></p>
    <div align="left">
    <table border="0" width="100%">
    <tr>
    <td width="34%" valign="middle" align="center">
    <font face="Arial" size="2">
    &nbsp;
    <INPUT
    TYPE=BUTTON
    NAME="cmdCalc"
    VALUE="Your Results!"
    onClick=AddItUp(this.form) style="font-weight: bold; border-style: solid; border-color: #00009B">&nbsp;&nbsp;</font><b><INPUT
    TYPE=TEXT
    NAME=total
    SIZE=7
    ></TD>


    **





    </p>1-2 points blah


    </td>
    <td width="66%" align="center">
    <p align="left"><font face="Arial" size="2"><b>7 points or more:</b>&nbsp;
    You are a good candidate for handling your own divorce!</font></p>
    </td>
    </tr>
    <tr>
    <td width="34%"></td>
    <td width="66%"><font face="Arial" size="2"><b>5-6 points:</b>&nbsp; This
    may be a strain for you.&nbsp;<br>
    </font></td>
    </tr>
    <tr>
    <td width="34%"></td>
    <td width="66%"><font face="Arial" size="2"><b>4 points or fewer:</b>
    Strongly consider hiring an attorney.&nbsp;</font></td>
    </tr>
    </table>
    <font face="Arial" size="1">n</font><font face="Arial" size="2">&nbsp;


    </font></div>

    </FORM>


    <font FACE="Times New Roman" SIZE="2">
    <hr size="3" color="#DD0000">


    </font>


    <p align="right">&nbsp;</p>


    <p align="right">&nbsp;</p>


    </body>

    </html>

  • #2
    Have you tried to update the code yourself?
    What problems are you having when you tried to update the code?

    Comment


    • #3
      problems so far HELP

      If i get rid of the value drop down boxes and replace them with radiogroup1 boxes (numberes 0-5 values 1-5) renaming them first , when i click results nothing happens.

      please use the code above it works save it as any html file you want.
      so if i remove this (drop down)
      <SELECT NAME="first">
      <OPTION VALUE=1>Yes
      <OPTION VALUE=0>No
      </SELECT>

      and replace it with
      <label>
      <input type="radio" name="RadioGroup1" value="1">
      yes</label>
      <br>


      any ideas
      <label>
      <input type="radio" name="RadioGroup1" value="0">
      no</label>

      when i hit get results .....nothing....

      maybe something to do with

      function AddItUp(form) {
      var item, firstValue, secondValue, thirdValue, fourthValue, fifthValue, sixthValue, seventhValue, eighthValue,
      ninthValue

      // Get the value of the item that's selected in the first list
      item = form.first.selectedIndex;
      firstValue = eval(form.first.options[item].value)

      Comment

      Working...
      X