ballouta Posted June 18, 2008 Share Posted June 18, 2008 Hello I have this form: <FORM name=frm method="POST" action="register.php"> <p dir="ltr" style="margin-bottom: 15px"> <font face="Verdana" color="#FF0000" style="font-size: 9pt; font-style: italic"> required fields</font></p> <table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0"> <tr> <td width="87"><font face="Verdana" size="2">Full Name</font></td> <td width="23"> <p align="center"><font face="Verdana" size="2">:</font></td> <td> <input type="text" name="fname" size="20" style="color: #000000"></td> </tr> <tr> <td width="87"><font face="Verdana" size="2">Email</font></td> <td width="23"> <p align="center"><font face="Verdana" size="2">:</font></td> <td> <input type="text" name="email" size="20" style="color: #000000"></td> </tr> <tr> <td width="87"><font face="Verdana" size="2">Mobile #</font></td> <td width="23"> <p align="center"><font face="Verdana" size="2">:</font></td> <td> <input type="text" name="mobile" size="20" style="color: #000000"></td> </tr> <tr> <td width="87"><font face="Verdana" size="2">Country</font></td> <td width="23"> <p align="center"><font face="Verdana" size="2">:</font></td> <td> <input type="text" name="country" size="20" style="color: #000000"></td> </tr> <tr> <td width="87"><font face="Verdana" size="2">password</font></td> <td width="23"> <p align="center"><font face="Verdana" size="2">:</font></td> <td> <input type="password" name="pass" size="20" style="color: #000000"></td> </tr> and this javascript in a separate file, it working properly. function isReady() { // check if the First Name is valid if (isProper(frm.fname.value) == false) { alert("Please enter your First Name"); return false; } // check if the email address is valid if (isEmail(frm.email.value) == false) { alert("Please enter a valid email address"); return false; } return true; } I need to add to code: 1) mobile verification, only numbers are allowed, no matter how long 2) make sure that the password is between 8 and 12 characters. Thanks alot Quote Link to comment Share on other sites More sharing options...
xtopolis Posted June 18, 2008 Share Posted June 18, 2008 Add it, let us know how it works. When you run into trouble, show us. Quote Link to comment Share on other sites More sharing options...
ballouta Posted June 18, 2008 Author Share Posted June 18, 2008 I don't know how to make the mobile and password check functions. Please help Quote Link to comment Share on other sites More sharing options...
xtopolis Posted June 18, 2008 Share Posted June 18, 2008 You will want to look into Regular Expressions for both PHP and Javascript (cannot trust that someone won't turn javascript off in order to circument your filter). Google it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.