Im trying to implement this and Im not sure if there is a syntax
difference in returning a value of a checkbox vs a dropdown menu. Is
(return $("#referrer").val() == 'Other') the proper way to test the
value of a checkbox? It certainly works for dropdown menus..

Here is my new code, mimicking the syntax of the example you provided:

        $("#signupForm").validate({
                rules: {
                        referrer: {
                                required: true,
                                minlength: 1
                        },
                        referrerother: {
                                        required: function(element){
                                                return $("#referrer").val() == 
'Other'
                                        },
                                        minlength: 1
                        }
                },
                messages: {
                        referrerother: "If you select 'other', you must enter 
it."
                }
        });


Here is my updated code:
http://psylicyde.com/misc/jquery-validate/demo/test.html

Reply via email to