0

I have to make a custom validation for a fiel what be must validate by api.

The server response is always a array [], that can be empty, 1 result, n result.

My valid case is when is exaclty 1, the other 2 must be separeted in two diferent error messages.

The problem particulary is, the default remote option doesn´t work for my custom rule, and the async validation always fail.

Considere this code as example :

http://jsfiddle.net/84fefw4z/2/

  • How can add a remote rule validation with: jQuery.validator.addMethod(...); ?
  • Is possible add a rule with 2 error messages?
vmariano
  • 473
  • 2
  • 19
  • Ok, aparently I can´t custom validate with ajax. http://stackoverflow.com/questions/2628413/jquery-validator-and-a-custom-rule-that-uses-ajax – vmariano Apr 08 '15 at 18:11
  • Show the code within the OP, not relying on the jsFiddle alone. Also, I do not understand why the `remote` rule is not something you can use instead of re-creating it from scratch. – Sparky Apr 08 '15 at 18:40

0 Answers0