I'm here with a problem validating my form, every time I change the Country I load the page again:
<select class="form-control" id="pais" name="pais"
onchange="document.getElementById('form_user').action='';this.form.submit();">
I do this to add new fields if the country is Portugal.
The problem is that I'm using JQuery's validate and the validation of this and other fields disappears when I change the country, because I download the page again.
How can I keep the validation fields always working, as soon as I click at least once button ?
How do I validate:
$('#form_user').validate({
rules: {
nome: {
minlength: 3,
maxlength: 50,
required: true
},
//outros campos...
pais: {
valueNotEquals: "0"
}
}
//mensagens, etc...
});