Advertisement
jeffnh79

Submit

Oct 15th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.68 KB | None | 0 0
  1. <script>
  2.  
  3.  
  4. function check_form(RegistrationForm){
  5.  
  6. FNAME.innerHTML="1";
  7. LOGIN.innerHTML="1";
  8. Phone.innerHTML="";
  9.  
  10. FormOK = "true";
  11. var regexPhNum = /^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/;
  12. var regexUserName = /^[a-z][\w\.]{6,24}$/i;
  13.  
  14. if(regexPhNum.test(RegistrationForm.cnumber.value)==false){
  15. Phone.innerHTML="Invalid Phone Number";
  16. FormOK = "false";
  17. }
  18.  
  19. if(RegistrationForm.fname.value == ""){
  20. FNAME.innerHTML="Invalid Name";
  21. FormOK = "false";
  22. }
  23.  
  24. if(RegistrationForm.lname.value == ""){
  25. LNAME.innerHTML="Invalid Name";
  26. FormOK = "false";
  27. }
  28.  
  29. if(regexUserName.test(RegistrationForm.login.value)==false){
  30. LOGIN.innerHTML="Invalid UserName";
  31. FormOK = "false";
  32. }
  33. return FormOK;
  34. }
  35.  
  36. </script>
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43. <form name="Registration" method="POST" onSubmit="return check_form(this)" >
  44.  
  45. <div class="textleft">FirstName:</div>
  46. <div class="textright"><input name="fname" type="text" class="textfield" maxlength="30" value="<?php echo $fname; ?>"/><font color="Red"><span id = "FNAME"></span> </font>
  47. </div>
  48. <div class="textleft">LastName:</div>
  49. <div class="textright"><input name="lname" type="text" class="textfield" maxlength="30" value="<?php echo $lname; ?>"/><font color="Red"><span id = "LNAME"></span> </font>
  50. </div>
  51. <div class="textleft">UserName:</div>
  52. <div class="textright"><input name="login" type="text" class="textfield" maxlength="20" value="<?php echo $login; ?>"/><font color="Red"><?php echo $vlogin; ?> </font><font color="Red"><span id ="LOGIN"></span></font>
  53. </div>
  54. <div class="textleft">Password:</div>
  55. <div class="textright"><input name="password2" type="password" class="textfield" maxlength="80" value="<?php echo $password; ?>"/><font color="Red"><?php echo $vpassword; ?> </font>
  56. </div>
  57. <div class="textleft">Retype Password:</div>
  58. <div class="textright"><input name="cpassword" type="password" class="textfield" maxlength="80" value="<?php echo $cpassword; ?>"/><font color="Red"><?php echo $vcpassword; ?> </font><font color="Red"><?php echo $errorMessage; ?> </font>
  59. </div>
  60. <div class="textleft">Address:</div>
  61. <div class="textright"><input name="address" type="text" class="textfield" maxlength="200" value="<?php echo $address; ?>"/><font color="Red"><?php echo $vaddress; ?> </font>
  62. </div>
  63. <div class="textleft">Contact Number:</div>
  64. <div class="textright"><input name="cnumber" type="text" class="textfield" maxlength="20" size="40" value="<?php echo $cnumber; ?>" /><font color="Red"><span id = "Phone"></span><?php echo $vcnumber; ?> </font>
  65. <input name="propic" id="dadded" type="hidden" value="upload/p.jpg" /></div>
  66. <div class="textleft">Email:</div>
  67. <div class="textright"><input name="email" type="text" class="textfield" maxlength="100" value="<?php echo $email; ?>"><font color="Red"><?php echo $vemail; ?> </font><font color="Red"><?php echo $emailErrorMessage; ?> </font>
  68. </div>
  69. <div class="textleft">Gender:</div>
  70. <div class="textright1">
  71. <div class="input-container">
  72. <select name="gender" id="gender" class="textfield1">
  73. <option></option>
  74. <option >Female</option>
  75. <option >Male</option>
  76. </select><font color="Red"><?php echo $vgender; ?></font><br />
  77. </div>
  78. </div>
  79. <div class="textleft">Birth Day:</div>
  80. <div class="textright"><input name="month" type="text" class="date"><font color="Red"><?php echo $vbirthday; ?></font></div>
  81. <div class="input-container">
  82.  
  83. <div class="textright">
  84. <input type="submit" name="Submit" value="Sign Up" class="greenButton1"/> <!--button to submit registration /-->
  85.  
  86. </div>
  87.  
  88. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement