Advertisement
Guest User

reeeeeeeeeeeee

a guest
May 21st, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.83 KB | None | 0 0
  1. <html>
  2.  
  3. <head>
  4. <title> Computer System Order Form </title>
  5. <script>
  6. function doClear()
  7. {
  8.  
  9. document.ComputerForm.Address1.value ="";
  10. document.ComputerForm.Address2.value ="";
  11. document.ComputerForm.FullName.value ="";
  12. document.ComputerForm.City.value = "";
  13. document.ComputerForm.State.value = "";
  14. document.ComputerForm.Zip.value = "";
  15. document.ComputerForm.Phone.value = "";
  16. document.ComputerForm.Email.value = "";
  17.  
  18. document.ComputerForm.case[0].checked = false;
  19. document.ComputerForm.case[1].checked = false;
  20. document.ComputerForm.case[2].checked = false;
  21.  
  22. document.ComputerForm.monitor[0].checked = false;
  23. document.ComputerForm.monitor[1].checked = false;
  24. document.ComputerForm.monitor[2].checked = false;
  25.  
  26. document.ComputerForm.printer[0].checked = false;
  27. document.ComputerForm.printer[1].checked = false;
  28. document.ComputerForm.printer[2].checked = false;
  29.  
  30. return;
  31. }
  32.  
  33. function doSubmit()
  34. {
  35.  
  36. if (validateRadio() == false)
  37. {
  38. alert("Please Select All of the Required Circles.");
  39. return;
  40. }
  41. if (validateText() == false)
  42. {
  43. alert("Required Data Missing.");
  44. return;
  45. }
  46. alert("Your computer Order Has Been Submitted.");
  47. return;
  48.  
  49. }
  50.  
  51.  
  52. function validateRadio()
  53. {
  54. if (document.ComputerForm.case[0].checked) return true;
  55. if (document.ComputerForm.case[1].checked) return true;
  56. if (document.ComputerForm.case[2].checked) return true;
  57. if (document.ComputerForm.monitor[0].checked) return true;
  58. if (document.ComputerForm.monitor[1].checked) return true;
  59. if (document.ComputerForm.monitor[2].checked) return true;
  60. if (document.ComputerForm.printer[0].checked) return true;
  61. if (document.ComputerForm.printer[1].checked) return true;
  62. if (document.ComputerForm.printer[2].checked) return true;
  63. return false;
  64. }
  65.  
  66. function validateText()
  67. {
  68. var Address1 = document.ComputerForm.Address1.value;
  69. if (Address1.length == 0) return false;
  70.  
  71. var FullName = document.ComputerForm.FullName.value;
  72. if (FullName.length == 0) return false;
  73.  
  74. var City = document.ComputerForm.City.value;
  75. if (City.length == 0) return false;
  76.  
  77. var State = document.ComputerForm.State.value;
  78. if (State.length == 0) return false;
  79.  
  80. var Zip = document.ComputerForm.Zip.value;
  81. if (Zip.length == 0) return false;
  82.  
  83. var Email = document.ComputerForm.Email.value;
  84. if (Email.length == 0) return false;
  85.  
  86. var Phone = document.ComputerForm.Phone.value;
  87. if (Phone.length == 0) return false;
  88. return;
  89. }
  90.  
  91. </script>
  92. </head>
  93.  
  94. <body>
  95. <form name="ComputerForm">
  96. <h1> Computer System Order Form </h1>
  97. <table align="center" border="1" bordercolor="black" cell padding="10" cellspacing="0">
  98. <tr>
  99. <td>
  100. <table cellpadding="5">
  101. <tr>
  102. <td>
  103. <p>
  104. <h4> Computer Case Style: </h4>
  105. <font face: "Courier New">
  106. <input name="case" type="radio"> Desktop Case ($500.00) <br> <input name="case" type="radio"> Mini-Tower Case ($600.00) <br> <input name="case" type="radio"> Full Tower Case ($700.00) <br>
  107. </td>
  108. <td>
  109. <img src="pc-case.jpg" width="125px" height="125px">
  110. </td>
  111. </tr>
  112. <tr>
  113. <td>
  114. </font>
  115. </p>
  116.  
  117. <p>
  118. <h4> Computer Monitor: </h4>
  119. <font face: "Courier New">
  120. <input name="monitor" type="radio"> 17" LCD Flat Screen ($250.00) <br> <input name="monitor" type="radio"> 19" LCD Flat Screen ($300.00) <br> <input name="monitor" type="radio"> 21" LCD Flat Screen ($350.00) <br>
  121. <td>
  122. <img src="computer-case.jpg" width="125px" height="125px">
  123. </td>
  124. </tr>
  125. <tr>
  126. <td>
  127. <br>
  128. </font>
  129. </p>
  130.  
  131. <p>
  132. <h4> Computer Printer: </h4>
  133. <font face: "Courier New">
  134. <input name="printer" type="radio"> Inkjet Printer ($100.00) <br> <input name="printer" type="radio"> Laser Printer ($250.00) <br> <input name="printer" type="radio"> Color Laser Printer ($300.00) <br>
  135. <td>
  136. <img src="printer.jpg" width="125px" height="125px">
  137. </td>
  138. </tr>
  139. </table>
  140. </td>
  141. <td>
  142. <table cellpadding="5">
  143. <tr>
  144. <td>
  145. Total System Price:
  146. </td>
  147. <td>
  148. <input name="Total" readonly="true" size="8" type="text" value="0.00">
  149. </td>
  150. </tr>
  151. <tr>
  152. <td colspan="2">
  153. <hr>
  154. </td>
  155. </tr>
  156. <tr>
  157. <td>
  158. Full Name:<br>
  159. </td>
  160. <td>
  161. <input name="FullName" Size="24" type="text"><br>
  162. </td>
  163. </tr>
  164. <tr>
  165. <td>
  166. Street Address:<br>
  167. <br>
  168. </td>
  169. <td>
  170. <input name="Address1" size="24" type="text"><br>
  171. <input name="Address2" size="24" type="text"><br>
  172. </td>
  173. </tr>
  174. <tr>
  175. <td>
  176. City, State, Zip:<br>
  177. </td>
  178. <td>
  179. <input name="City" size="16" type="text">
  180. <input name="State" size="2" type="text">
  181. <input name="Zip" size="8" type="text"> <br>
  182. </td>
  183. </tr>
  184. <tr>
  185. <td>
  186. Phone Number:<br>
  187. </td>
  188. <td>
  189. <input name="Phone" size="24" type ="text"><br>
  190. </td>
  191. </tr>
  192. <tr>
  193. <td>
  194. Email Address:<br>
  195. </td>
  196. <td>
  197. <input name="Email" size="24" type="text"><br>
  198. </td>
  199. </tr>
  200. <tr>
  201. <td colspan="2">
  202. <hr>
  203. </td>
  204. </tr>
  205.  
  206.  
  207. <tr>
  208. <td align="center" colspan="2">
  209. <input type="button" value="Submit Order" onClick="doSubmit()">
  210. <input type="button" value="Clear Values" onClick="doClear()">
  211. </tr>
  212. </td>
  213. </table>
  214.  
  215. </p>
  216.  
  217.  
  218. </form>
  219. </body>
  220. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement