Results 1 to 3 of 3

Thread: HTML Form Parts based on Radio Button Selection

  1. #1
    Join Date
    Apr 2011
    Seattle, WA

    Question HTML Form Parts based on Radio Button Selection

    Ok, so I need to have this:

    O - New Version
    O - Variation of Previous Version
    (Where the "O"s are radio buttons)

    And if they click "New version" then I need to offer a text-field called "title" and be done with it...

    But if they click "Variation" then I need to offer a selection drop-down of titles from previous versions (like Old One A, Old One B, Old One C, etc) and a text field called "variation" for them to input something like "extra space" or "light color" etc.

    And, obviously, I want it to do this without refreshing the page and as fluidly as possible.

    Any advice?

  2. #2
    Join Date
    Nov 2010
    <style type="text/css">
    .hide {display:none}
    <script type="text/javascript">
    function toggle(style1,style2) {
    <input type="radio" name="rad" onclick='toggle("block","none")'/> New Version <br>
    <input type="radio" name="rad" onclick='toggle("none","block")'/> Variation of Previous Version<br>
    <div class="hide" id="div1">
    a div with some stuff in it
    <div class="hide" id="div2">
    a different div, with different stuff in it

  3. #3
    Join Date
    Nov 2009
    What you need is to set rules (conditional logic) on your radio buttons field. If you prefer not coding it, I suggest you use this form generator for your job, 123ContactForm. It allows setting rules with ease, and the fields will be visible without any refresh, as it works on a JavaScript interface. You can also tweak the codes if you want, I am very content with that feature. Hope it wil work fine for you too!
    Cheers, R

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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