minsung

complete correct passworrd messaging

......@@ -40,6 +40,17 @@ function checkValidation(self){
}
function checkPasswordMatch() {
var password = $("#fpassword").val();
var confirmPassword = $("#spassword").val();
if (password != confirmPassword)
$("#message").html("비밀번호가 일치하지 않습니다.!");
else
$("#message").html("일치.");
}
/*
$(document).ready(function () {
$('#eValidation').keyup(function () {
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
......@@ -63,3 +74,4 @@ $('#fpassword, #spassword').on('keyup', function () {
$('#message').html('비밀번호가 일치하지 않습니다').css('color', 'red');
});
});
*/
......
......@@ -10,23 +10,43 @@
</script>
<script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/jquery.validate.min.js">
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
$('#fValidation, #sValidation').on('keyup', function () {
if ($('#fValidation').val() == $('#sValidation').val()) {
$('#message').html('일치').css('color', 'green');
} else
$('#message').html('비밀번호가 일치 하지않습니다.').css('color', 'red');
});
$(document).ready(function () {
$('#eValidation').keyup(function () {
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
$('#eValidation').keyup(function () {
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
if (re.test($(this).val())) {
if (re.test($(this).val())) {
$(this).css("borderColor", "green");
$(this).css("borderColor", "green");
} else {
} else {
$(this).css("borderColor", "red");
}
});
$(this).css("borderColor", "red");
}
});
});
$(document).ready(function () {
$('#fValidation, #sValidation').on('keyup', function () {
if ($('#fValidation').val() == $('#sValidation').val()) {
$('#message').html('일치').css('color', 'green');
} else
$('#message').html('비밀번호가 일치 하지않습니다.').css('color', 'red');
});
});
</script>
</head>
<body>
......@@ -54,6 +74,7 @@ $(document).ready(function () {
<label for="password">비밀번호 확인:</label><br>
<input class="inputset" id="sValidation" type="password" name="checkpassword" placeholder="비밀번호를 입력하세요." ><br>
<span id='message'></span>
<label for="name">이름:</label><br>
......
......@@ -26,7 +26,11 @@
padding:20px;
}
.inputset{
margin-bottom: 20px;
}
.image
{
display: block;
......