sdy
...@@ -40,28 +40,12 @@ function checkValidation(self){ ...@@ -40,28 +40,12 @@ function checkValidation(self){
40 40
41 } 41 }
42 42
43 -function focusFunction(id) { 43 +function checkPasswordMatch() {
44 -document.getElementById(id).focus(); 44 + var password = $("#fpassword").val();
45 -} 45 + var confirmPassword = $("#spassword").val();
46 - 46 +
47 -function blurFunction(id) { 47 + if (password != confirmPassword)
48 - document.getElementById(id).style.borderColor="2px solid"; 48 + $("#message").html("비밀번호가 일치하지 않습니다.!");
49 - document.getElementById(id).style.borderColor="red"; 49 + else
50 -} 50 + $("#message").html("일치.");
51 -
52 -function validate(self){
53 - var email=document.getElementById('eValidation').value;
54 - var regExp = /^[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*@[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*.[a-zA-Z]{2,3}$/i;
55 - var fpassword=document.getElementById('fValidation').value;
56 - var spassword= document.getElementById('sValidation').value;
57 - var x = document.getElementById(".inputset");
58 - $(document).ready(function(){
59 - if(regExp.test(email)){
60 - return true;
61 - }else if(email=""){
62 -
63 - return false;
64 - }else return true;
65 -
66 - });
67 } 51 }
......
...@@ -10,6 +10,39 @@ ...@@ -10,6 +10,39 @@
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 +<script type="text/javascript">
15 +$(document).ready(function () {
16 +$('#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,}))$/;
18 +
19 + if (re.test($(this).val())) {
20 +
21 + $(this).css("borderColor", "green");
22 +
23 + } else {
24 +
25 + $(this).css("borderColor", "red");
26 +
27 + }
28 +});
29 +});
30 +
31 +$(document).ready(function () {
32 +$('#fValidation, #sValidation').on('keyup', function () {
33 + if ($('#fValidation').val() == $('#sValidation').val()) {
34 + $('#message').html('일치').css('color', 'green');
35 +
36 + } else
37 + $('#message').html('비밀번호가 일치 하지않습니다.').css('color', 'red');
38 +
39 +});
40 +});
41 +
42 +
43 +
44 +</script>
45 +
13 </head> 46 </head>
14 <body> 47 <body>
15 48
...@@ -36,9 +69,11 @@ ...@@ -36,9 +69,11 @@
36 <input class="inputset" id="fValidation" type="password" name="password" placeholder="비밀번호를 입력하세요." ><br> 69 <input class="inputset" id="fValidation" type="password" name="password" placeholder="비밀번호를 입력하세요." ><br>
37 70
38 <label for="password">비밀번호 확인:</label><br> 71 <label for="password">비밀번호 확인:</label><br>
39 - <input class="inputset" id="sValidation" type="password" name="checkpassword" placeholder="비밀번호를 입력하세요." ><br> 72 + <input class="inputset" id="sValidation" type="password" name="checkpassword" placeholder="비밀번호를 입력하세요." >
40 - 73 + <br>
41 - 74 + <span id='message'></span>
75 + <br>
76 + <br>
42 <label for="name">이름:</label><br> 77 <label for="name">이름:</label><br>
43 <input class="inputset"type="text" name="name" placeholder="이름을 입력하세요." ><br> 78 <input class="inputset"type="text" name="name" placeholder="이름을 입력하세요." ><br>
44 79
......
...@@ -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;
......