Thursday 15 January 2015

validation - jQuery Validate errorClass not working -


I have this verification code:

  $ ("# valid"). Validate ({Rules: {// My other rules // My other rules / My other rules My crane: {expected: true, remote: "./validate-minecraft.php"}}, Message: {minecraft: {Remote "Error", "Error-inline", errorElement: "span", highlight: function (element, error class, valid class) {$ (element) (' Error '); $ (element). Parents ('. Control-group '),). AddClass (' success');} Submit submit handler: function (form) {jQuery ("#BTN-deposit"). AddClass ("disabled"); ("valid"). Submit ();}});   

Everything properly, mine Exaspts with remote for the craft area.

Validate my PHP script- minecraft.php returns correctly or incorrectly correctly, error message is displayed correctly if it loses, but

What is wrong?

Thanks

You may need to remove the "success" category on the highlight.

  Highlight: Function (Element, Error Class, Valid Class) {$ (Element). Parents ('Control-Group'). RemoveClass ('success'); $ (Element) .parents ('control group.') AddClass ('error'). },   

When I tested on your site, I noticed that the control group's diagram looks like this:

  & lt; Div class = "control-group success error" & gt;   

Now the strange thing is that it does this even when trying for the first time, not sure how the success class is added. But what can be done with this remote validator? I tried to do it locally with a digit verifier and did not add the success class on initial error.

Either way you should remove still on user input error class

No comments:

Post a Comment