Hello.
I am working on a form with multiple text-entry boxes and I am using jQuery to give messages to the User for each field.
So far every field works correctly except for the last field, "Company": When a User enters any text the message should disappear, behaving like the other fields do but it does not.
Snippet of script being used, below:
`
<!--Rules & Messages-->
<script src='jquery.validate.min.js'></script>
<script>
$("#DemoForm").validate({
rules: {
'username': {
required: true
},
'email': {
required: true,
email: true,
},
'password': {
required: true,
minlength: 6,
maxlength: 10,
},
'cfmPassword': {
equalTo: "#password",
minlength: 6,
maxlength: 10,
},
'city': {
required: true
},
'zip': {
required: true
},
'company': {
required: true
},
},
messages: {
'username': {
required:'Please enter a username.'
},
'email': {
required:'Please enter your email.',
email:'Please enter a valid email.'
},
'password': {
required:"A password is required."
},
'city': {
required:"Please enter your city."
},
'zip': {
required:"Please enter your zip code."
},
'company': {
required:"Please enter the company you work/worked for."
}
}
});
</script>
Thank you in advance!