Articles → Jquery → Form Validation In Jquery

Form Validation In Jquery






Forgot Password Screen


Picture showing the forgot password screen
Click to Enlarge





$(document).ready(function() {});




$(document).ready(function() {
	$("#<%= btnRetrievePassword.ClientID %>").click(function() {});
});




jQuery.trim(<textbox_text>.length




$(document).ready(function() {
	$("#<%= btnRetrievePassword.ClientID %>").click(function() {
		var emailText = $("#<%= txtEmailID.ClientID %>").val();
		if(jQuery.trim(emailText).length == 0) {
			//  Write a logic to handle it
		}
	});
});






var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;




$("#<%= btnRetrievePassword.ClientID %>").click(function() {
	var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
	var emailText = $("#<%= txtEmailID.ClientID %>").val();
	if(jQuery.trim(emailText).length == 0) {
		//  Write a logic to handle it
	} else if(!emailReg.test(emailText)) {
		//  Write a logic to handle it
	}
});





Summary





Posted By  -  Karan Gupta
 
Posted On  -  Saturday, December 24, 2011

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250