WEB Making checkboxes appear IFF a certain radio is clicked.

Discussion in 'OT Technology' started by brds, Mar 3, 2009.

  1. brds

    brds OT Supporter

    Joined:
    Jun 26, 2006
    Messages:
    17,647
    Likes Received:
    15
    Location:
    Atlanta
    I'm creating a form wizard to help out new employees with the amount of paperwork they have to do. One of the questions is "Have you ever served in the military?" If the user selects no, i want nothing to happen. However, if they select yes, I would like for a list of armed service branches to appear with a checkbox next to each one so the user can check which branch(es) they served in.

    I'm not even sure what the name for this type of thing is. I dont know javascript at all, but I def. need to learn it. Any help would be appreciated.
     
  2. brds

    brds OT Supporter

    Joined:
    Jun 26, 2006
    Messages:
    17,647
    Likes Received:
    15
    Location:
    Atlanta
  3. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    if you're gonna do it with javascript, you should also give the user a warning, or disable the form, if they happen to have javascript disabled.. and you need to check the form values at the submit stage before storing them
     
  4. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    you can disable the form by setting the css display value to none, then use javascript to change it after the document has loaded

    so if they don't have javascript enabled.. the form will not be displayed, and you can use noscript to give them a message telling them to turn it on
     

Share This Page