I'm using Jquery Validate to validate a form. I've added a custom validation method via
$.validator.addMethod
If I add this method to a textbox, the validation will work without problems.
I want this custom validation method to highlight a certain div container that I create via JavaScript. If I change the following line (inside of "rules" in the .validate call)
"MyTextbox":
{
MyMethod: true,
},
to use the ID of the div I created via JavaScript, my custom validation rule will be ignored (the other rules will still apply).
I'm struggling to find the corresponding documentation. It seems that I can only add a rule an input element and not to a div. Am I approaching this the wrong way? How can I add a rule, that appends a message after a certain div-element, if the validation fails?
inputelement and need help placing the message or are you looking for a way to validate thediv?