Guest User

Untitled

a guest
Nov 20th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. <html>
  2. <head>
  3.  
  4. <script type="text/JavaScript">
  5. function isempty(field,message)
  6. {
  7.  
  8. if(field.length==0)
  9. {
  10.  
  11. alert(message);
  12. return false;
  13. }
  14. return true;
  15. }
  16. function isempty1(field,message)
  17. {
  18.  
  19. if(field.length<50)
  20. {
  21.  
  22. alert(message);
  23. return false;
  24. }
  25. return true;
  26. }
  27. function ischecked(field,message)
  28. {
  29.  
  30. if(!field.checked)
  31. {
  32.  
  33. alert(message);
  34. return false;
  35. }
  36. return true;
  37. }
  38. function fnsubmit()
  39. {
  40.  
  41. if(isempty(document.getElementById("LoginId").value,"LoginId cannot be empty"))
  42. {
  43. if(isempty(document.getElementById("Email").value,"email cannot be empty"))
  44. {
  45. if(isempty(document.getElementById("Name").value,"Name cannot be empty"))
  46. {
  47. if(isempty(document.getElementById("Homepage").value,"Homepage cannot be empty"))
  48. {
  49. if(isempty1(document.getElementById("text1").value,"TextArea cannot be less then 50 characters"))
  50. {
  51. if(ischecked(document.getElementById("checkbox1"),"Check the checkbox"))
  52. return true;
  53. }
  54. }
  55. }
  56. }
  57. }
  58. return false;
  59. }
  60.  
  61.  
  62.  
  63.  
  64. </script>
  65. <style type="text/css">
  66. .header
  67. {
  68. width:100%;
  69. text-align:center;
  70. font-size:36px;
  71. background-color:green;
  72. }
  73. body
  74. {
  75. background-color:#E0FFFF;
  76. }
  77. table
  78. {
  79. border:4px;
  80.  
  81. margin-left:400px;
  82.  
  83.  
  84. }
  85. select
  86. {
  87. width:150px;
  88. background-color:white;
  89. }
  90. td
  91. {
  92. width:200px;
  93. }
  94. button
  95. {
  96.  
  97. float:center;
  98. }
  99. .left
  100. {margin-left:400px;
  101. width:500px;
  102. }
  103. .left-center
  104. {text-align:center;
  105.  
  106. }
  107. label
  108. {
  109. font-weight:bold;
  110. }
  111. button
  112. {
  113. background-color:green;
  114. }
  115. </style>
  116. </head>
  117. <body>
  118. <form onsubmit=" return fnsubmit();">
  119. <div class="header">
  120. Registration form
  121. </div>
  122. <table>
  123. <tr><td>Login ID</td><td><input type="text" id="LoginId"/></td></tr>
  124. <tr><td>Email</td><td><input type="text" id="Email" style="background-color:yellow;"/></td></tr>
  125. <tr><td>Name</td><td><input type="text" id="Name" style="background-color:yellow;"/></td></tr>
  126. <tr><td>Time Zone</td><td>
  127. <select>
  128.  
  129. <option name="GMT" value="G">GMT</option>
  130. <option name="IST" value="G">IST</option>
  131. </td></tr>
  132. <tr><td>Homepage</td><td><input type="text" id="Homepage"/></td></tr>
  133. <tr><td>ABOUT ME</td></tr>
  134. </table>
  135. <br>
  136. <div class ="left">
  137. <textarea cols='55' rows='12' id="text1">
  138. </textarea><br>
  139. <input type="checkbox" id="checkbox1"/> <label for="checkbox1"> Recieve Notification of comments</label><br>
  140. You will be able to receive notification when somenone comments on your profile<br><br><br>
  141. <div class="left-center">
  142. Your password will be mailed to you<br><br><br>
  143.  
  144. <button type="submit" value="submit">Go</button>
  145. </div>
  146. </div>
  147.  
  148. </form>
  149. </body>
  150. </html>
Add Comment
Please, Sign In to add comment