Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How can I make my drop down choice mandatory (forms)?

    Hey,
    I've scourged the internet but haven't found anything about this question: How did I make it mandatory for users to choose an option from a dropdown menu?
    the site: http://turfmaster.cc/pay_pal.html

    I want users to able to select either Orlando or Tampa before being allowed to click on the PayPal button...Possible?

    Attached is my coding, as I am trying to do it for a website. I know very little about JavaScript so any help would be hot.

    Much appreciated,
    Zachary
    Attached Files Attached Files

  • #2
    New Coder TripperTreats's Avatar
    Join Date
    Oct 2006
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts
    make the paypal button disabled, as in:

    <input type="button" disabled="disabled"........

    After a user chooses an option, have the onclick handler enable the button:

    <select onclick="PayPalButton.disabled=''" .......

    After the equal sign that's two apostrophes, ' '(without the space in between), and then the closing quotation mark ".
    Psychedelic digital art at www.trippertreats.com.

    "And in the end, the love you take
    is equal to the love you make
    ."

  • #3
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    While javascript is a great solution for many things, mandatory validation is not one of them. While many internet users are not technically inclined, just as many are, and will quickly clue into a simple solution that can be typed into the URL bar to bypass any javascript validation if they've a mind to. Javascript validation is a nice thing to use in addition to server-side validation, to save the users' time (and server bandwidth) if they happen to have script enabled. It should never be relied upon as the only validation.

    It also breaks the form for disabled users who use text-to-speech browsers. Breaking things for disabled users is illegal in the UK and is iffy here in the States if it is a commercial website (ADA).

    A compliant option would be to have an intermediate server-side form that does the validation and redirects to Paypal upon success. You could use this in addition to client-side script if you like.

    Or you could just not have a blank option at all. If it isn't valid to have no selection, why have a "select region" blank option at all? Radio buttons are another option if you've only got a few choices, with one default selected.

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #4
    New Coder TripperTreats's Avatar
    Join Date
    Oct 2006
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Excellent discussion nikkiH, thank you for the info. I had no idea that it was illegal in the UK; that's interesting.
    Psychedelic digital art at www.trippertreats.com.

    "And in the end, the love you take
    is equal to the love you make
    ."

  • #5
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    The States are starting to require more along that line as well, and IIRC there was actually a lawsuit against a commercial company a couple months ago. Not 100% certain on that; I just remember hearing something about it.

    (It's the ADA in the States, the DDA in the UK, and both are more about discrimination than usability per se.)

    Not everyone follows the rules, of course, but from what I gather from other boards, it is more vigorously enforced in the UK. This is hearsay, so I won't say I'm certain on that. I know it comes up more often on the boards I go to where there are more non-US posters.

    Here are a few links on the subject.

    US: http://www.ada.gov/websites2.htm
    Mostly US-centric, links to tips as well: http://websitetips.com/accessibility/
    UK article:
    http://www.bytestart.co.uk/content/l...irements.shtml
    UK: http://www.web-accessibility.co.uk/legal.asp

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/


  •  

    Posting Permissions

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