Submit Form after Validation jQuery example

Submit Form after validation jquery:

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

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:

484 total views, 5 views today

Leave a Reply

Your email address will not be published. Required fields are marked *