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