title: Order form total textbox from radio buttons
body: <p>I'm working on a project for class where we need to implement a couple of features. Right now the one that I'm stuck on is making the value in the order total textbox update automatically as users make selections using the radio buttons in the ComputerForm. If anyone could tell me how I should script this it would be most appreciated. </p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
   &lt;head&gt;
      &lt;title&gt; Final: Computer Order Form &lt;/title&gt;
      &lt;meta name="Generator" content="EditPlus"&gt;
      &lt;meta name="Author" content="Joshua Aslan Smith"&gt;
      &lt;meta name="Keywords" content=""&gt;
      &lt;meta name="Description" content="Final Project"&gt;
  
      &lt;script type="text/javascript"&gt;
  
          function doClear()
              {
                  document.AddressForm.customer.value = "";
                  document.AddressForm.address.value = "";
                  document.AddressForm.city.value= "";
                  document.AddressForm.state.options[0].selected = "true";
                  document.AddressForm.zip.value = "";
                  document.AddressForm.phone.value= "";
                  document.AddressForm.email.value= "";
  
                  document.ComputerForm.cases[0].checked = false;
                  document.ComputerForm.cases[1].checked = false;
                  document.ComputerForm.cases[2].checked = false;
  
                  document.ComputerForm.monitors[0].checked = false;
                  document.ComputerForm.monitors[1].checked = false;
                  document.ComputerForm.monitors[2].checked = false;
  
                  document.ComputerForm.printers[0].checked = false;
                  document.ComputerForm.printers[1].checked = false;
                  document.ComputerForm.printers[2].checked = false;
  
                  return;
              }
  
          //function totalPrice()
              //{
              //  var t1 = document.ComputerForm.cases.selected.value;
              //  var t2 = document.ComputerForm.monitors.selected.value;
              //  var t3 = document.ComputerForm.printers.selected.value;
              //  var total = document.AddressForm.total.value;
  
          //      total.value = t1.value + t2.value + t3.value;
          //  }
  
      &lt;/script&gt;
  
  
  &lt;/head&gt;
  
  &lt;body&gt;  &lt;h1 align="center"&gt;Computer System Order Form&lt;/h1&gt;  &lt;table border="black" cellpadding="10px" align="center"&gt;        &lt;tr&gt;            &lt;td&gt;
                  &lt;table cellpadding="10px"&gt;
                  &lt;form name="ComputerForm"&gt;
                      &lt;tr&gt;
                          &lt;td&gt;
                              Computer Case Style:&lt;/br&gt;
                              &lt;input type="radio" name="cases" value="500.00" /&gt; Desktop Case (500.00) &lt;/br&gt;
                              &lt;input type="radio" name="cases" value="600.00" /&gt; Mini-Tower Case (600.00) &lt;/br&gt;
                              &lt;input type="radio" name="cases" value="700.00" /&gt; Full-Tower Case (700.00) &lt;/br&gt;
                          &lt;/td&gt;
                          &lt;td&gt;
                              &lt;img src="case.jpg" alt="pc case" &gt;/&gt;   
                          &lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;
                              Computer Monitor: &lt;br/&gt;
                              &lt;input type="radio" name="monitors" value="250.00" /&gt; 17" LCD Flat Screen (250.00) &lt;/br&gt;
                              &lt;input type="radio" name="monitors" value="300.00" /&gt; 19" LCD Flat Screen (300.00) &lt;/br&gt;
                              &lt;input type="radio" name="monitors" value="350.00" /&gt; 21" LCD Flat Screen (350.00) &lt;/br&gt;
                          &lt;/td&gt;
                          &lt;td&gt;
                              &lt;img src="monitor.jpg" alt="pc &gt;monitor" /&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;
                              Computer Printer:&lt;br/&gt;
                              &lt;input type="radio" name="printers" value="100.00" /&gt; Inkjet Printer (100.00) &lt;/br&gt;
                              &lt;input type="radio" name="printers" value="250.00" /&gt; Laser Printer (250.00) &lt;/br&gt;
                              &lt;input type="radio" name="printers" value="350.00" /&gt; Color Printer (350.00) &lt;/br&gt;
                          &lt;/td&gt;
                          &lt;td&gt;
                              &lt;img src="printer.jpg" alt="pc printer" /&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt;
                  &lt;/form&gt;
                  &lt;/table&gt;            &lt;/td&gt;           &lt;td&gt;
                  &lt;table padding="10px"&gt;
                      &lt;tr&gt;
                      &lt;form name="AddressForm"&gt;
                          &lt;td&gt;
                              Total System Price:
                          &lt;/td&gt;
                          &lt;td&gt;
                              $&lt;input type="text" name="total" readonly value="0.00" size="8"&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;
                              &amp;nbsp;
                          &lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;
                              &amp;nbsp;
                          &lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;
                              &amp;nbsp;
                          &lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;
                              Full Name:
                          &lt;/td&gt;
                          &lt;td&gt;
                              &lt;input type="text" name="customer" /&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;
                              Street Address:
                          &lt;/td&gt;
                          &lt;td&gt;
                              &lt;input type="text" name="address" /&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;
                              City:
                          &lt;/td&gt;
                          &lt;td&gt;
                              &lt;input type="text" name="city" /&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;
                              State:
                          &lt;/td&gt;
                          &lt;td&gt;
                              &lt;select name="state"&gt;
                                  &lt;option value=""&gt;&lt;/option&gt;
                                  &lt;option value="DE"&gt;DE&lt;/option&gt;
                                  &lt;option value="NJ"&gt;NJ&lt;/option&gt;
                                  &lt;option value="NY"&gt;NY&lt;/option&gt;
                                  &lt;option value="PA"&gt;PA&lt;/option&gt;
                              &lt;/select&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;
                              Zip:
                          &lt;/td&gt;
                          &lt;td&gt;
                              &lt;input type="text" name="zip" /&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;
                              Phone Number:
                          &lt;/td&gt;
                          &lt;td&gt;
                              &lt;input type="text" name="phone" /&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;
                              Email Address:
                          &lt;/td&gt;
                          &lt;td&gt;
                              &lt;input type="text" name="email"&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;/form&gt;
                      &lt;tr&gt;
                          &lt;td&gt;
                              &amp;nbsp;
                          &lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;
                              &lt;input type="button" value="Submit Order" onClick="doSubmit()" /&gt;
                          &lt;/td&gt;
                          &lt;td&gt;
                              &lt;input type="button" value="Clear Form" onClick="doClear()"  /&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt;
                  &lt;/table&gt;            &lt;/td&gt;       &lt;/tr&gt;   &lt;/table&gt; &lt;/body&gt; &lt;/html&gt;
  </code></pre>