Jquery Tutorials
- What is JQuery
- DOM Document Object Model
- JQuery Syntax
- Jquery Selector
- Get & Set Form value
- jQuery - Attributes
- Attribute Methods
- jQuery - DOM Manipulation
- JQuery Events
- JQuery Effects
- JQuery Html/Css
- jQuery Insert Content
- Auto Hide Div
- JQuery noConflict()
- JQuery Form Validation
- Form Validation
- Login Form Validation
- Jquery Fadeout message
- Modal popup
- Jquery Ajax Forms
- Dependent Dropdown
- Autocomplete Country jquery ajax
- Dynamic Content Load using jQuery AJAX
- Dynamic star rating jQuery AJAX
- Drag and Drop Image Upload
- show Hide Elements By click on checkbox
- How to Add class in jQuery
- calculate discount in jQuery
- Calculate GST by input value in text box
- check Password strength in jQuery
- Count Remaining Character
- onClick Checkbox check all
- password match or not
- DataTable
- Date Picker
- Multiselect Dropdown with Checkbox
- Add Dynamic Input Field (Add More Input Field)
- submit button disable after one click
- Show hide password in Password textbox using checkbox
- Put value in the text field
- Set Data and Attributes
Customer Say
Check password or confirm password is match or not.?
Check password or confirm password is match or not.
File name : index.php
<html>
<head>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript">
function checkPasswordMatch() {
var password = $("#password").val();
var confirmPassword = $("#repassword").val();
if (password != confirmPassword)
$("#divCheckPasswordMatch").html("Passwords do not match!");
else
$("#divCheckPasswordMatch").html("Passwords match.");
}
$(document).ready(function () {
$("#repassword").keyup(checkPasswordMatch);
});
</script>
</head>
<body>
<input class="form-control" placeholder="password" type="password" name="password" id="password">
<input class="form-control" placeholder="Repeat password" type="password" name="repassword" id="repassword" onChange="checkPasswordMatch();">
<div class="registrationFormAlert" id="divCheckPasswordMatch"> </div>
<button type="submit" class="btn btn-primary btn-block"> Create Account </button>
</body>
</html>
Example :-
File name : index.php
<form method="post" name="form1" id="form-password" action="">
<fieldset>
<label>Password:</label>
<input type="password" name="password" id="password" value="" size="32" />
<label>Re-Enter Password:</label>
<input type="password" name="password-check" id="password-check" value="" size="32" />
<input type="submit" value="Submit" id="submit">
</fieldset>
</form>
jQuery(function(){
$("#submit").click(function(){
$(".error").hide();
var hasError = false;
var passwordVal = $("#password").val();
var checkVal = $("#password-check").val();
if (passwordVal == '') {
$("#password").after('<span class="error">Please enter a password.</span>');
hasError = true;
} else if (checkVal == '') {
$("#password-check").after('<span class="error">Please re-enter your password.</span>');
hasError = true;
} else if (passwordVal != checkVal ) {
$("#password-check").after('<span class="error">Passwords do not match.</span>');
hasError = true;
}
if(hasError == true) {return false;}
});
});
File name : index.php
File name : index.php
File name : index.php
File name : index.php