dcsimg
www.webdeveloper.com
Results 1 to 4 of 4

Thread: limiting choices with checkboxes

  1. #1
    Join Date
    Nov 2002
    Location
    Canada
    Posts
    11

    limiting choices with checkboxes

    Hi

    I understand that I need to use radio buttons when only one selection is wanted for an answer. I would like to have the days of the week and offer my visitors either the choice of one or two days that they can pick from the seven. How do I do this?

    Thanks for any help!

  2. #2
    Join Date
    Nov 2002
    Posts
    984
    You could use checkboxes instead of radio buttons, as this will alow users to automatically choose mutiple selection.

    You will still need eg JavaScript to check that noone marks more then 2 boxes, but it seems simpler to code then using radiobuttons.

    If you have access to serverside methods you could also do the form validation serverside and thus not have to rely on clientside scripting at all.

  3. #3
    Join Date
    Nov 2002
    Posts
    631
    Or you could make the radio buttons names different. When all their names are the same eg:

    <input type="radio" name="radioset">
    <input type="radio" name="radioset">
    <input type="radio" name="radioset">
    <input type="radio" name="radioset">

    The visitor will only be able to select one.


    If the names are different:

    <input type="radio" name="radio1">
    <input type="radio" name="radio2">
    <input type="radio" name="radio3">
    <input type="radio" name="radio4">

    The visitor will be able to select more than one.

  4. #4
    Join Date
    Nov 2002
    Location
    Canada
    Posts
    11

    thank you!

    I didn't know that about the radio buttons so that's great to know. I ended up finding a little script at 3am this morning(by Dr Joe no less) that let me do what I was wanting to do. Thanks so much for the help/advice - it's most appreciated

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



Recent Articles