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,10 +10,19 @@
</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 () {
$('#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())) {
......@@ -24,9 +33,20 @@ $(document).ready(function () {
$(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;
......