I have a strange problem with JQuery.validate
The forms validate fine, the errorClass works, but the custom messages don't come through I just get the generic ones.
I've checked the contents of stack exchange and it seems to be either typos or not specifying the name field in the html.
Can someone point me in the right direction here?
HTML
<form action="#" method="POST" id="vlanForm" name="vlanForm">
<div class="flip"><h3>Add VLAN</h3></div>
<div class="panel">
VLAN ID:<input type="text" id="vlan" name="vlan"><br>
<input type="submit" class="button" style="position: absolute;right: 7px;" name="vlanSubmit" value="Send"><br></div>
</form>
Javascript
$("#vlanForm").validate({
errorClass: 'wrong',
rules: {
vlan: {
required: true,
number: true
},
messages: {
vlan: {
required: "Please enter a vlan",
number: "Number only please"
}
}
}
});
As I say, the validation on the form works, the custom class works, but the messages don't, despite the name field being set on each. Apologies in advance if it is just a Typo I'm being blind on but I've looked over it many times.