Question

I am using Jquery Validate plugin for a form. Everything works fine except if I tab to the submission button it changes the text color. I have tried using the "ignore:" option then specify the class of the submission button in the validate() function but this doesn't work.

$("#edit_phone_form").validate({
    ignore: ".orange-button",
    rules: {
        phone_number: {
            required: true,
            phoneUS: true
        }
    }
});

If anyone knows how I can tell Validate to ignore the ".orange-button" class please let me know. I have no code that is manipulating this button so I know Validate is doing something since it does this same text effect with all other form elements.

Thanks!

Was it helpful?

Solution

Quote OP:

" have no code that is manipulating this button so I know Validate is doing something since it does this same text effect with all other form elements."

There is absolutely nothing in the jQuery Validate plugin that is affecting the color/look/style of your buttons... nothing at all. Even when the plugin adds or removes classes on validation, it does not contain any CSS properties, nor does it manipulate any CSS properties, period.

Furthermore, the plugin doesn't validate buttons since they have nothing to do with entering data into the form. The plugin only validates the various "data input" elements, text boxes, text areas, select lists, radios and checkboxes... and nothing else. Then if the form data passes/fails validation, a success/error class is applied to the element along with a new element containing an error message.

Here is a demo with what you've described in your OP: http://jsfiddle.net/5vFCg/

<input type="submit" class="orange-button" /> 

As you can see, the submit buttons are rendered as default browser buttons, and their look is totally unaltered from the browser default, proving that jQuery Validate is doing nothing to these buttons.

You must have overlooked something. Show enough code to create a demo of what you're seeing.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top