View Full Version : How can I make my drop down choice mandatory (forms)?
12-27-2006, 03:01 AM
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?
12-27-2006, 11:00 AM
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 ".
12-27-2006, 03:33 PM
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.
12-27-2006, 07:58 PM
Excellent discussion nikkiH, thank you for the info. I had no idea that it was illegal in the UK; that's interesting.
12-27-2006, 09:07 PM
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.
Mostly US-centric, links to tips as well: http://websitetips.com/accessibility/
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.