SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Aug 2000
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is probably easy, but I flipped through the first 100 posts and couldn't find a similar question.

    I would like to set up a form with multiple radio boxes in a table. The first row containing two selections, second containing 2..... Once the 1st row/column is selected, the 1st row/2nd column automatically displays the information from the first selection.

    I am not necessarily looking for exact code on how to do this, just reference points to go to, and preferably suggestions on the best(meaning quickest) language to do this with.

    TIA

  2. #2
    SitePoint Addict Drinky's Avatar
    Join Date
    Jan 2001
    Location
    England
    Posts
    338
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This should start you off.
    Code:
    <html>
    <head>
    <script>
    <!--
    function setValues(elm){
      var d = document.forms[0];
      switch (elm.name){
        case "r0":
          d.rr0[elm.value].checked = true;
          break;
        case "r1":
          d.rr1[elm.value].checked = true;
          break;
        case "r2":
          d.rr2[elm.value].checked = true;
          break;
      }
    }
    //-->
    </script>
    </head>
    <body>
    <form>
    <table>
      <tr>
        <td>
          <input type="radio" name="r0" value="0" onClick="javascript:setValues(this);return true;"><br>
          <input type="radio" name="r1" value="0" onClick="javascript:setValues(this);return true;"><br>
          <input type="radio" name="r2" value="0" onClick="javascript:setValues(this);return true;"><br>
        </td>
        <td>
          <input type="radio" name="r0" value="1" onClick="javascript:setValues(this);return true;"><br>
          <input type="radio" name="r1" value="1" onClick="javascript:setValues(this);return true;"><br>
          <input type="radio" name="r2" value="1" onClick="javascript:setValues(this);return true;"><br>
        </td>
        <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
        <td>
          <input type="radio" name="rr0" value="0"><br>
          <input type="radio" name="rr1" value="0"><br>
          <input type="radio" name="rr2" value="0"><br>
        </td>
        <td>
          <input type="radio" name="rr0" value="1"><br>
          <input type="radio" name="rr1" value="1"><br>
          <input type="radio" name="rr2" value="1"><br>
        </td>
      </tr>
    </table>
    </form>
    </body>
    </html>
    Last edited by Drinky; Feb 7, 2001 at 01:25.
    Drinky


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •