Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title> Computer System Order Form </title>
- <script>
- function doClear()
- {
- document.ComputerForm.Address1.value ="";
- document.ComputerForm.Address2.value ="";
- document.ComputerForm.FullName.value ="";
- document.ComputerForm.City.value = "";
- document.ComputerForm.State.value = "";
- document.ComputerForm.Zip.value = "";
- document.ComputerForm.Phone.value = "";
- document.ComputerForm.Email.value = "";
- document.ComputerForm.case[0].checked = false;
- document.ComputerForm.case[1].checked = false;
- document.ComputerForm.case[2].checked = false;
- document.ComputerForm.monitor[0].checked = false;
- document.ComputerForm.monitor[1].checked = false;
- document.ComputerForm.monitor[2].checked = false;
- document.ComputerForm.printer[0].checked = false;
- document.ComputerForm.printer[1].checked = false;
- document.ComputerForm.printer[2].checked = false;
- return;
- }
- function doSubmit()
- {
- if (validateRadio() == false)
- {
- alert("Please Select All of the Required Circles.");
- return;
- }
- if (validateText() == false)
- {
- alert("Required Data Missing.");
- return;
- }
- alert("Your computer Order Has Been Submitted.");
- return;
- }
- function validateRadio()
- {
- if (document.ComputerForm.case[0].checked) return true;
- if (document.ComputerForm.case[1].checked) return true;
- if (document.ComputerForm.case[2].checked) return true;
- if (document.ComputerForm.monitor[0].checked) return true;
- if (document.ComputerForm.monitor[1].checked) return true;
- if (document.ComputerForm.monitor[2].checked) return true;
- if (document.ComputerForm.printer[0].checked) return true;
- if (document.ComputerForm.printer[1].checked) return true;
- if (document.ComputerForm.printer[2].checked) return true;
- return false;
- }
- function validateText()
- {
- var Address1 = document.ComputerForm.Address1.value;
- if (Address1.length == 0) return false;
- var FullName = document.ComputerForm.FullName.value;
- if (FullName.length == 0) return false;
- var City = document.ComputerForm.City.value;
- if (City.length == 0) return false;
- var State = document.ComputerForm.State.value;
- if (State.length == 0) return false;
- var Zip = document.ComputerForm.Zip.value;
- if (Zip.length == 0) return false;
- var Email = document.ComputerForm.Email.value;
- if (Email.length == 0) return false;
- var Phone = document.ComputerForm.Phone.value;
- if (Phone.length == 0) return false;
- return;
- }
- </script>
- </head>
- <body>
- <form name="ComputerForm">
- <h1> Computer System Order Form </h1>
- <table align="center" border="1" bordercolor="black" cell padding="10" cellspacing="0">
- <tr>
- <td>
- <table cellpadding="5">
- <tr>
- <td>
- <p>
- <h4> Computer Case Style: </h4>
- <font face: "Courier New">
- <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>
- </td>
- <td>
- <img src="pc-case.jpg" width="125px" height="125px">
- </td>
- </tr>
- <tr>
- <td>
- </font>
- </p>
- <p>
- <h4> Computer Monitor: </h4>
- <font face: "Courier New">
- <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>
- <td>
- <img src="computer-case.jpg" width="125px" height="125px">
- </td>
- </tr>
- <tr>
- <td>
- <br>
- </font>
- </p>
- <p>
- <h4> Computer Printer: </h4>
- <font face: "Courier New">
- <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>
- <td>
- <img src="printer.jpg" width="125px" height="125px">
- </td>
- </tr>
- </table>
- </td>
- <td>
- <table cellpadding="5">
- <tr>
- <td>
- Total System Price:
- </td>
- <td>
- <input name="Total" readonly="true" size="8" type="text" value="0.00">
- </td>
- </tr>
- <tr>
- <td colspan="2">
- <hr>
- </td>
- </tr>
- <tr>
- <td>
- Full Name:<br>
- </td>
- <td>
- <input name="FullName" Size="24" type="text"><br>
- </td>
- </tr>
- <tr>
- <td>
- Street Address:<br>
- <br>
- </td>
- <td>
- <input name="Address1" size="24" type="text"><br>
- <input name="Address2" size="24" type="text"><br>
- </td>
- </tr>
- <tr>
- <td>
- City, State, Zip:<br>
- </td>
- <td>
- <input name="City" size="16" type="text">
- <input name="State" size="2" type="text">
- <input name="Zip" size="8" type="text"> <br>
- </td>
- </tr>
- <tr>
- <td>
- Phone Number:<br>
- </td>
- <td>
- <input name="Phone" size="24" type ="text"><br>
- </td>
- </tr>
- <tr>
- <td>
- Email Address:<br>
- </td>
- <td>
- <input name="Email" size="24" type="text"><br>
- </td>
- </tr>
- <tr>
- <td colspan="2">
- <hr>
- </td>
- </tr>
- <tr>
- <td align="center" colspan="2">
- <input type="button" value="Submit Order" onClick="doSubmit()">
- <input type="button" value="Clear Values" onClick="doClear()">
- </tr>
- </td>
- </table>
- </p>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement