minsung

focus on, onblur

1 +
1 var Email={ 2 var Email={
2 - checkEmail:function(self){ 3 + checkEmail:function(id){
3 var email=document.getElementById('eValidation').value; 4 var email=document.getElementById('eValidation').value;
4 var regExp = /^[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*@[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*.[a-zA-Z]{2,3}$/i; 5 var regExp = /^[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*@[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*.[a-zA-Z]{2,3}$/i;
5 if(regExp.test(email)){ 6 if(regExp.test(email)){
...@@ -38,13 +39,29 @@ function checkValidation(self){ ...@@ -38,13 +39,29 @@ function checkValidation(self){
38 39
39 } 40 }
40 41
41 -function ajaxvalidation(self){ 42 +function focusFunction(id) {
42 - $(document).ready(function(){ 43 +document.getElementById(id).focus();
43 - var email=document.querySelector('#evalidation'); 44 +}
44 - var fpassword=document.querySelector('#evalidation');
45 45
46 - }) 46 +function blurFunction(id) {
47 + document.getElementById(id).style.borderColor="2px solid";
48 + document.getElementById(id).style.borderColor="red";
49 +}
47 50
51 +function validate(self){
52 + var email=document.getElementById('eValidation').value;
53 + var regExp = /^[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*@[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*.[a-zA-Z]{2,3}$/i;
54 + var fpassword=document.getElementById('fValidation').value;
55 + var spassword= document.getElementById('sValidation').value;
56 + var x = document.getElementById(".inputset");
57 + $(document).ready(function(){
58 + if(regExp.test(email)){
59 + return true;
60 + }else if(email=""){
48 61
62 + return false;
63 + }else return true;
49 64
65 + });
50 } 66 }
67 +*/
......
...@@ -27,20 +27,20 @@ ...@@ -27,20 +27,20 @@
27 <div id="inputset"> 27 <div id="inputset">
28 <form class="signinform" action="loginmain.html" onsubmit="return checkValidation()" method="post"> 28 <form class="signinform" action="loginmain.html" onsubmit="return checkValidation()" method="post">
29 <label for="email">이메일:</label><br> 29 <label for="email">이메일:</label><br>
30 - <input id="eValidation"type="text" name="email" placeholder="이메일을 입력하세요." ><br> 30 + <input class="inputset" id="eValidation"type="text" name="email" onblur="validateinput()" placeholder="이메일을 입력하세요." ><br>
31 31
32 <label for="password">비밀번호:</label><br> 32 <label for="password">비밀번호:</label><br>
33 - <input id="fValidation" type="password" name="password" placeholder="비밀번호를 입력하세요." ><br> 33 + <input class="inputset" id="fValidation" type="password" name="password" onblur="" placeholder="비밀번호를 입력하세요." ><br>
34 34
35 <label for="password">비밀번호 확인:</label><br> 35 <label for="password">비밀번호 확인:</label><br>
36 - <input id="sValidation" type="password" name="checkpassword" placeholder="비밀번호를 입력하세요." ><br> 36 + <input class="inputset" id="sValidation" type="password" name="checkpassword" onblur="" placeholder="비밀번호를 입력하세요." ><br>
37 37
38 38
39 <label for="name">이름:</label><br> 39 <label for="name">이름:</label><br>
40 - <input type="text" name="name"placeholder="이름을 입력하세요." ><br> 40 + <input class="inputset"type="text" name="name" onblur="" placeholder="이름을 입력하세요." ><br>
41 41
42 <label for="age">나이:</label><br> 42 <label for="age">나이:</label><br>
43 - <input type="text" name="age" placeholder="나이를 입력하세요." ><br><br> 43 + <input class="inputset"type="text" name="age" onblur="" placeholder="나이를 입력하세요." ><br><br>
44 44
45 <label for="sex">성별:</label><br> 45 <label for="sex">성별:</label><br>
46 <input type="radio" value="man" name="sex">남자<br> 46 <input type="radio" value="man" name="sex">남자<br>
......