minsung

complete correct passworrd messaging

...@@ -40,6 +40,17 @@ function checkValidation(self){ ...@@ -40,6 +40,17 @@ function checkValidation(self){
40 40
41 } 41 }
42 42
43 +function checkPasswordMatch() {
44 + var password = $("#fpassword").val();
45 + var confirmPassword = $("#spassword").val();
46 +
47 + if (password != confirmPassword)
48 + $("#message").html("비밀번호가 일치하지 않습니다.!");
49 + else
50 + $("#message").html("일치.");
51 +}
52 +
53 +/*
43 $(document).ready(function () { 54 $(document).ready(function () {
44 $('#eValidation').keyup(function () { 55 $('#eValidation').keyup(function () {
45 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,}))$/; 56 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 () { ...@@ -63,3 +74,4 @@ $('#fpassword, #spassword').on('keyup', function () {
63 $('#message').html('비밀번호가 일치하지 않습니다').css('color', 'red'); 74 $('#message').html('비밀번호가 일치하지 않습니다').css('color', 'red');
64 }); 75 });
65 }); 76 });
77 +*/
......
...@@ -10,10 +10,19 @@ ...@@ -10,10 +10,19 @@
10 </script> 10 </script>
11 <script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/jquery.validate.min.js"> 11 <script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/jquery.validate.min.js">
12 </script> 12 </script>
13 +<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
14 +
13 <script type="text/javascript"> 15 <script type="text/javascript">
14 16
17 +$('#fValidation, #sValidation').on('keyup', function () {
18 + if ($('#fValidation').val() == $('#sValidation').val()) {
19 + $('#message').html('일치').css('color', 'green');
20 + } else
21 + $('#message').html('비밀번호가 일치 하지않습니다.').css('color', 'red');
22 +});
23 +
15 $(document).ready(function () { 24 $(document).ready(function () {
16 - $('#eValidation').keyup(function () { 25 +$('#eValidation').keyup(function () {
17 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,}))$/; 26 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,}))$/;
18 27
19 if (re.test($(this).val())) { 28 if (re.test($(this).val())) {
...@@ -24,9 +33,20 @@ $(document).ready(function () { ...@@ -24,9 +33,20 @@ $(document).ready(function () {
24 33
25 $(this).css("borderColor", "red"); 34 $(this).css("borderColor", "red");
26 } 35 }
27 - });
28 }); 36 });
37 +});
38 +
39 +$(document).ready(function () {
40 +$('#fValidation, #sValidation').on('keyup', function () {
41 + if ($('#fValidation').val() == $('#sValidation').val()) {
42 + $('#message').html('일치').css('color', 'green');
43 + } else
44 + $('#message').html('비밀번호가 일치 하지않습니다.').css('color', 'red');
45 +});
46 +});
47 +
29 </script> 48 </script>
49 +
30 </head> 50 </head>
31 <body> 51 <body>
32 52
...@@ -54,6 +74,7 @@ $(document).ready(function () { ...@@ -54,6 +74,7 @@ $(document).ready(function () {
54 74
55 <label for="password">비밀번호 확인:</label><br> 75 <label for="password">비밀번호 확인:</label><br>
56 <input class="inputset" id="sValidation" type="password" name="checkpassword" placeholder="비밀번호를 입력하세요." ><br> 76 <input class="inputset" id="sValidation" type="password" name="checkpassword" placeholder="비밀번호를 입력하세요." ><br>
77 +
57 <span id='message'></span> 78 <span id='message'></span>
58 79
59 <label for="name">이름:</label><br> 80 <label for="name">이름:</label><br>
......
...@@ -26,7 +26,11 @@ ...@@ -26,7 +26,11 @@
26 padding:20px; 26 padding:20px;
27 27
28 } 28 }
29 + .inputset{
30 + margin-bottom: 20px;
29 31
32 +
33 + }
30 .image 34 .image
31 { 35 {
32 display: block; 36 display: block;
......