jQuery Password match checking without using jQuery validate plugin
X

Congrats, You are Subscribed to Receive Updates.

jQuery Password match checking without using jQuery validate plugin


jQuery Password match checking without using jQuery validate plugin. Let’s start working with the Password match using jQuery. And begin with HTML code , Here its,

 <div class="form-group">
                <label class="col-sm-3 control-label"> New Password</label>
                <div class="col-sm-6">     <input type="text" class="form-control" name="kv_teacher_password_new"   id="kv_teacher_password_new" ></div>
              </div>
			  
			     <div class="form-group">
                <label class="col-sm-3 control-label">Confirm New Password</label>
                <div class="col-sm-6">     <input type="text" class="form-control" name="kv_teacher_confirm_password" id="kv_teacher_confirm_password" ></div>  <p id="kv_teacher_password_p" style="color: red; " ></p>
              </div>

and the above code will be verified with the following jQuery ,

jQuery("#kv_teacher_confirm_password").keyup(kv_password_match);

Because we are going to check the password with confirm password.  so we take the confirm password id and check keyup function , The below function will explain you more,

function kv_password_match() {
    var password = $("#kv_teacher_password_new").val();
    var confirmPassword = $("#kv_teacher_confirm_password").val();

    if (password != confirmPassword)
        $("#kv_teacher_password_p").html("Mismatch!");
    else{
		$("#kv_teacher_password_p").css("color", "green");
        $("#kv_teacher_password_p").html("Match.");
	}
}

That’s it. Now your code will check whether the password is matched or not.

 

commenter

About Varadharaj V

The founder of Kvcodes, Varadharaj V is an ERP Analyst and a Web developer specializing in WordPress(WP), WP Theme development, WP Plugin development, Frontaccounting(FA), Sales, Purchases, Inventory, Ledgers, Payroll & HRM, CRM, FA Core Customization, OpenCart Theme Development, PHP, HTML, CSS, jQuery, Bootstrap development and content SEO.

Comment Below

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

*

Current ye@r *

Menu

Sidebar

Subscribe E-mail Updates

Congrats, You are Subscribed to Receive Updates.

Advertisement

Category Posts