I'm having trouble getting jquery.validation.js to validate a select box. It is working on the text inputs, but it does not display an error message for the select. If I fulfill validation on the text inputs, it submits. Does anyone see what I'm missing here?
<form name="consumerRegistration" id="consumerRegistration" action="" method="post">
<label for="name" class="baseline-10">Full Name</label>
<input type="text" name="name" id="name" class="required" placeholder="John Doe" min-length="2"/>
<label for="email" class="baseline-10">Email</label>
<input type="text" name="email" id="email" class="required email" placeholder="[email protected]"/>
<label for="company" class="baseline-10">Company</label>
<input type="text" name="company" id="company" placeholder="ie. Yahoo"/>
<select name="country" id="country" class="required" required="required">
<option selected="" val="" disabled="disabled">Country</option>
<option val="United States">United States</option>
<option val="Canada">Canada</option>
</select>
<a href="javascript:document.void(1);" title="Register" class="cta"><span>Register</span></a>
(function($){
if($('form#consumerRegistration').length){
$('input').placeholder();
$('form#consumerRegistration').find('a').on('click', function(e){
e.preventDefault();
if($('form#consumerRegistration').valid()){
$('form#consumerRegistration').submit();
} else {
return false;
}
});
}
})(jQuery);
If I've missed a solution somewhere else in the site, I swear I've looked thouroughly. :)
The plugin is from http://bassistance.de/jquery-plugins/jquery-plugin-validation/ .