Loading ...
Sorry, an error occurred while loading the content.

6319Re: [NH] HTML radio button forms with submission capability

Expand Messages
  • Rudolf Horbas
    Apr 26, 2008
      Hi Mike,

      > I am looking for examples of form list using radio buttons.
      >
      > Heree is what I wan to do.
      >
      > Create a list with button for each item.
      > Any number of items can be selected.

      "Any number" meaning multiple selections or just one item?
      For the latter, radio buttons would be right; multiple choices require
      checkboxes.

      Here's a simple example with both, using php:

      ------------------------------------------------------
      <form method="post" action="<?=$_SERVER['PHP_SELF']?>">

      Radio buttons:
      <ul style="list-style-type: none;">
      <li>
      <input type="radio" name="foo" value="Foo" />
      Foo
      </li>
      <li>
      <input type="radio" name="bar" value="Bar" />
      Bar
      </li>
      </ul>

      Checkboxes:
      <ul style="list-style-type: none;">
      <li>
      <input type="checkbox" name="checkbox[foo]" value="Foo" />
      Foo
      </li>
      <li>
      <input type="checkbox" name="checkbox[bar]" value="Bar" />
      Bar
      </li>
      </ul>

      <input type="submit" value="Send" />
      </form>
      These are the form values that are being submitted:
      <pre>
      <?php
      print_r( $_POST );
      ?>
      </pre>

      ------------------------------------------------------

      > When selection is finished and submission made, the output is saved as
      > a text file.

      That's where the trickier part starts: processing the values.
      Where'd you want to save the text file? On the server? Or on the
      client's computer?

      Rudi
    • Show all 4 messages in this topic