צריך עזרה בגאווה => אורך סיסמא וניקוי טופס .
הודעה זו נכתבה על-ידי אורן בתאריך: 12.02.08 - שעה: 20:57:55
הצלחתי אם השם הגיל והאימיל אבל לא אם הסיסמא ואני צריך גם ניקוי טופס "rest"
<html> <head> <script type="text/javascript"> function validate() { var pass=document.getElementById("pass") var at=document.getElementById("email").value.indexOf("@") var age=document.getElementById("age").value var fname=document.getElementById("fname").value submitOK="true" if (pass.length<4) { alert("The password must be munimum 4 characters") subitOK="false" } if (fname.length>10) { alert("The name must be less than 10 characters") submitOK="false" } if (age<1||age>100) { alert("The age must be a number between 1 and 100") submitOK="false" } if (at==-1) { alert("Not a valid e-mail!") submitOK="false" } if (submitOK=="false") { return false } } </script> </head>
<body> <form action="aaa.htm" onsubmit="return validate()"> <table border="1" width="31%"> <tr> <td>Name</td> <td> <input type="text" id="fname" size="20" name="T2"></td> </tr> <tr> <td>Age</td> <td> <input type="text" id="age" size="20" name="T3"></td> </tr> <tr> <td>E-mail</td> <td> <input type="text" id="email" size="20" name="T4"></td> </tr> <tr> <td>Password</td> <td> <input type="password" id="pass" size="20" name="T1"></td> </tr> </table> <p> <input type="submit" value="Submit"> </p> </form> </body>
</html>
|
כפתור ריסט
הודעה זו נכתבה על-ידי amosexy בתאריך: 07.03.08 - שעה: 11:22:21
אתה מגדיר את הTYPE של הכפתור RESET וזה מאפס לך את כל הפורם....
ו... אתה יכול למנוע הקלדה יותר מאורך שקבעת עם הפונקציה ONKEYDOWN ולעקוב כמה תווים יש בכל הקלדה של אות או כל לחיצה של מקש...
| |