I am a beginner in jQuery manipulation. I have a form that is validated in server side with no errors(problems), but when I try to add a second form validation it doesn't work, the while validation don't work anymore nothing is displayed.
Here is my code :
<script>
function seen() {
$("#mss").slideUp(1000);
};
$(document).ready(function() {
setTimeout(function() {seen();}, 5000);
$("#ForgotPass").validate({
rules : {
'ForgotPass:mailprofile' : {
email : true,
required : true
}
},
messages : {
'ForgotPass:mailprofile' : {
email : "Veuillez entrer une adresse e-mail valide",
required : "L'adresse e-mail est vide"
}
}
});
});
</script>
The second validation I need to add :
$("#loginFormId").validate({
rules : {
'loginFormId:mailprofile' : {
email : true,
required : true
}
'loginFormId:password' : {
required : true
}
},
messages : {
'loginFormId:mailprofile' : {
email : "Veuillez entrer une adresse e-mail valide",
required : "L'adresse e-mail est vide"
}
'loginFormId:password' {
required : "Le mot de passe est vide"
}
}
});
JSF Form loginFormId :
<h:form id="loginFormId" prependId="false">
<h:inputText class="form-control" id="mailprofile" value="#{userloginMB.mailprofile}"></h:inputText>
<h:outputLabel id="outLblUserMailId" for="mailprofile"
name="outLblUserMailNm" value="E-mail"></h:outputLabel>
</h:form>
Form ForgotPass
<h:form id="ForgotPass" class="form floating-label">
<h:inputText class="form-control" id="mailprofile" value="#{userloginMB.mailprofile}"></h:inputText>
<h:outputLabel id="MailidL" value="E-mail" for="mailprofile" name="MailnmL"></h:outputLabel>
The question : How to do both validation or even more while each have a different id ?