Site icon NgDeveloper

Submit Form after Validation jQuery example

Submit Form after validation jquery:

[html]function validations(){
if(($("#mobNum").val().length)==10){
$("#rcForm").submit();
}else{
//your content
}
}
[/html]

In the above example mobNum (#mobNum) is the id of the text box and rcForm(#rcForm) is the id of the Form. So here we are just checking whether the length of the text box is ten.

We must put onclick=”validations()” in the button.

Recommended Books:

Exit mobile version