Showing
2 changed files
with
34 additions
and
12 deletions
... | @@ -50,6 +50,31 @@ function checkPasswordMatch() { | ... | @@ -50,6 +50,31 @@ function checkPasswordMatch() { |
50 | $("#message").html("일치."); | 50 | $("#message").html("일치."); |
51 | } | 51 | } |
52 | 52 | ||
53 | + | ||
54 | +$(document).ready(function () { | ||
55 | +$('#eValidation').keyup(function () { | ||
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,}))$/; | ||
57 | + | ||
58 | + if (re.test($(this).val())) { | ||
59 | + | ||
60 | + $(this).css("borderColor", "green"); | ||
61 | + | ||
62 | + } else { | ||
63 | + | ||
64 | + $(this).css("borderColor", "red"); | ||
65 | + } | ||
66 | +}); | ||
67 | +}); | ||
68 | + | ||
69 | +$(document).ready(function () { | ||
70 | +$('#fValidation, #sValidation').on('keyup', function () { | ||
71 | + if ($('#fValidation').val() == $('#sValidation').val()) { | ||
72 | + $('#message').html('일치').css('color', 'green'); | ||
73 | + } else | ||
74 | + $('#message').html('비밀번호가 일치 하지않습니다.').css('color', 'red'); | ||
75 | +}); | ||
76 | +}); | ||
77 | + | ||
53 | /* | 78 | /* |
54 | $(document).ready(function () { | 79 | $(document).ready(function () { |
55 | $('#eValidation').keyup(function () { | 80 | $('#eValidation').keyup(function () { | ... | ... |
... | @@ -11,16 +11,7 @@ | ... | @@ -11,16 +11,7 @@ |
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> | 13 | <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> |
14 | - | ||
15 | <script type="text/javascript"> | 14 | <script type="text/javascript"> |
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 | - | ||
24 | $(document).ready(function () { | 15 | $(document).ready(function () { |
25 | $('#eValidation').keyup(function () { | 16 | $('#eValidation').keyup(function () { |
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,}))$/; | 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,}))$/; |
... | @@ -32,6 +23,7 @@ $('#eValidation').keyup(function () { | ... | @@ -32,6 +23,7 @@ $('#eValidation').keyup(function () { |
32 | } else { | 23 | } else { |
33 | 24 | ||
34 | $(this).css("borderColor", "red"); | 25 | $(this).css("borderColor", "red"); |
26 | + ref={eValidation.email} | ||
35 | } | 27 | } |
36 | }); | 28 | }); |
37 | }); | 29 | }); |
... | @@ -40,11 +32,15 @@ $(document).ready(function () { | ... | @@ -40,11 +32,15 @@ $(document).ready(function () { |
40 | $('#fValidation, #sValidation').on('keyup', function () { | 32 | $('#fValidation, #sValidation').on('keyup', function () { |
41 | if ($('#fValidation').val() == $('#sValidation').val()) { | 33 | if ($('#fValidation').val() == $('#sValidation').val()) { |
42 | $('#message').html('일치').css('color', 'green'); | 34 | $('#message').html('일치').css('color', 'green'); |
35 | + | ||
43 | } else | 36 | } else |
44 | $('#message').html('비밀번호가 일치 하지않습니다.').css('color', 'red'); | 37 | $('#message').html('비밀번호가 일치 하지않습니다.').css('color', 'red'); |
38 | + | ||
45 | }); | 39 | }); |
46 | }); | 40 | }); |
47 | 41 | ||
42 | + | ||
43 | + | ||
48 | </script> | 44 | </script> |
49 | 45 | ||
50 | </head> | 46 | </head> |
... | @@ -73,10 +69,11 @@ $('#fValidation, #sValidation').on('keyup', function () { | ... | @@ -73,10 +69,11 @@ $('#fValidation, #sValidation').on('keyup', function () { |
73 | <input class="inputset" id="fValidation" type="password" name="password" placeholder="비밀번호를 입력하세요." ><br> | 69 | <input class="inputset" id="fValidation" type="password" name="password" placeholder="비밀번호를 입력하세요." ><br> |
74 | 70 | ||
75 | <label for="password">비밀번호 확인:</label><br> | 71 | <label for="password">비밀번호 확인:</label><br> |
76 | - <input class="inputset" id="sValidation" type="password" name="checkpassword" placeholder="비밀번호를 입력하세요." ><br> | 72 | + <input class="inputset" id="sValidation" type="password" name="checkpassword" placeholder="비밀번호를 입력하세요." > |
77 | - | 73 | + <br> |
78 | <span id='message'></span> | 74 | <span id='message'></span> |
79 | - | 75 | + <br> |
76 | + <br> | ||
80 | <label for="name">이름:</label><br> | 77 | <label for="name">이름:</label><br> |
81 | <input class="inputset"type="text" name="name" placeholder="이름을 입력하세요." ><br> | 78 | <input class="inputset"type="text" name="name" placeholder="이름을 입력하세요." ><br> |
82 | 79 | ... | ... |
-
Please register or login to post a comment