Dropdowns are supported just fine. Just remove the value attribute
from the "select one" option and add a required rule for the field.
See also 
http://jquery.bassistance.de/validate/demo/radio-checkbox-select-demo.html

Jörn

On Sat, Jan 31, 2009 at 7:59 PM, Kathryn <kathry...@gmail.com> wrote:
>
> Hi all,
>
> I'm using the fantastic validation plugin (from bassistance.de) and
> have run into a little glitch. I understand the plugin doesn't
> currently handle dropdowns, but I found a possible solution on True
> Tribe (http://www.thetruetribe.com/jquery/1-jquery-api/68-jquery-
> plugin-validation-with-ajax). I can't get it to work, though. I'm
> pretty new to jQuery and am probably making an obvious error I can't
> see. Here's my jQuery code:
>
> $(document).ready(function(){
>    $("#reg_form").validate({
>
>        onfocusout: false,
>        onkeyup: false,
>        onclick: false,
>
>        rules: {
>        gender: {required:true},
>        spouse_attend: {required:true}
>        }
>
>   });
>
>        $validator.addMethod(
>        "select_class",
>        function(value, element) {
>        return this.optional(element) || ( value.indexOf("--Select One--") ==
> -1);
>        },
>        "Please select a class.");
>
> });
>
> And here's the dropdown I'm trying to validate.
>
> <select name='class_date' id='class_date' class='select_class'>
> <option value='--Select One--'>--Select One--</option>
> <option>Feb 16 - 20, 2009</option>
> <option>Mar 16 - 20, 2009</option>
> <option>Apr 13 - 17, 2009</option>
> <option>May 11 - 15, 2009</option>
> </select>
>
> What am I doing wrong? Or is there another way to do this?
>
> Thanks in advance!
>
> Kathryn
>

Reply via email to