I finally got this script from: http://www.mredkj.com/javascript/orderform.html I got it to work like I want it to with modifications (I'm not a programmer) but I did it. However, now I want all the input fields to be emailed to me. Here is what I do have on the top portion of the form: <script type="text/javascript" src="orderform04.js"></script> <script type="text/javascript"> //<![CDATA[ window.onload = setupScripts; function setupScripts() { var anOrder1 = new OrderForm(); } //]]> </script> <form id="frmOrder"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left"> </td> <td class="SmlText"> </td> <td class="SmlText"><font color="#CCCCCC">10x10 Flush Mount Album $<span id="txtPrice0">449</span></font><br> <font color="#CCCCCC"> <select id="sel0"> <option>Quantity</option> <option value="val0">None</option> <option value="val1">1 -- 10x10 Flush Mount Album</option> <option value="val2">2 -- 10x10 Flush Mount Albums</option> <option value="val3">3 -- 10x10 Flush Mount Albums</option> </select> </font> <font color="#CCCCCC"> </font></td> <td class="SmlText"> </td> <td class="SmlText"><font color="#CCCCCC">11x8.5 Story Book $<span id="txtPrice3">189.95</span></font><br> <font color="#CCCCCC"> <select id="sel3"> <option>Quantity</option> <option value="val0">None</option> <option value="val1">1 -- 11x8.5 Story Book</option> <option value="val2">2 -- 11x8.5 Story Book</option> <option value="val3">3 -- 11x8.5 Story Book</option> </select> </font></td> <td> </td> </tr> <tr> <td width="0%" align="left"> </td> <td width="5%" class="SmlText"> </td> <td width="47%" class="SmlText"><p> </p></td> <td width="9%" class="SmlText"> </td> <td width="35%" class="SmlText"> </td> <td width="4%"> </td> </tr> <tr> <td align="left"> </td> <td class="SmlText"> </td> <td class="SmlText"><font color="#CCCCCC">12x12 Flush Mount Album $<span id="txtPrice2">499</span></font><br> <font color="#CCCCCC"> <select id="sel2"> <option>Quantity</option> <option value="val0">None</option> <option value="val1">1 -- 12x12 Flush Mount Album</option> <option value="val2">2 -- 12x12 Flush Mount Albums</option> <option value="val3">3 -- 12x12 Flush Mount Albums</option> </select> </font></td> <td class="SmlText"> </td> <td class="SmlText"><font color="#CCCCCC">12x12 Story Book $<span id="txtPrice4">259.95</span></font><br> <font color="#CCCCCC"> <select id="sel4"> <option>Quantity</option> <option value="val0">None</option> <option value="val1">1 -- 12x12 Story Book</option> <option value="val2">2 -- 12x12 Story Book</option> <option value="val3">3 -- 12x12 Story Book</option> </select> </font></td> <td> </td> </tr> <tr> <td align="left"> </td> <td class="SmlText"> </td> <td class="SmlText"> </td> <td class="SmlText"> </td> <td class="SmlText"> </td> <td> </td> </tr> <tr> <td align="left"> </td> <td class="SmlText"> </td> <td class="SmlText"><font color="#CCCCCC">Additional Time? $<span id="txtPrice1">100/hr</span></font><br> <font color="#CCCCCC"> <select id="sel1"> <option>Please choose more time if required</option> <option value="val0">0</option> <option value="val1">1 hour</option> <option value="val2">2 hours</option> <option value="val3">3 hours</option> <option value="val4">4 hours</option> <option value="val5">5 hours</option> </select> </font></td> <td class="SmlText"> </td> <td class="SmlText"><font color="#CCCCCC">Additional Photographer? $<span id="txtPrice5">100/hr</span></font><br> <font color="#CCCCCC"> <select id="sel5"> <option>Please choose amount of hours required</option> <option value="val0">None</option> <option value="val2">2 hours</option> <option value="val3">3 hours</option> <option value="val4">4 hours</option> <option value="val5">5 hours</option> <option value="val6">6 hours</option> </select> </font></td> <td> </td> </tr> <tr> <td align="left"> </td> <td class="SmlText"> </td> <td class="SmlText"> </td> <td class="SmlText"> </td> <td class="SmlText"> </td> <td> </td> </tr> <tr> <td align="left"> </td> <td class="SmlText"> </td> <td class="SmlText"> </td> <td class="SmlText"> </td> <td class="SmlText"> </td> <td> </td> </tr> </table> <div align="center"><br> <br> <font color="#CCCCCC">Your Total Cost:</font><br> <strong><font color="#CCCCCC" size="3" face="Arial, Helvetica, sans-serif">$</font></strong> <input type="text" id="txtTotal" size="15" /> </div> </form> The dilema I am having now is how to have the above selections to be included in my other form I created using Form Builder provided with my hosting service, which is just below the coding I have listed above. If anyone would like to see a mock up of the web page, here is the link: http://www.digitalimagesbypablo.com/wedding_contract_info1.htm The 'Product Add Ons' works just like I wanted it to with calculaltions of add-ons plus the cost of base price $750. Now I just need to have all information (Add-ons and Wedding Information)emailed. Can anyone help me?
I forgot to add the orderform04.js code: // mredkj.com // OrderForm.js - v0.4 // v0.4 - 2007-02-01 // v0.3 - 2006-04-09 // v0.2 - 2006-04-08 // v0.1 - 2006-04-06 function OrderForm(prefix, precision, firstChoice) { this.prefix = prefix ? prefix : ''; // **************************** // Configure here // **************************** // names - Set these according to how the html ids are set this.FORM_NAME = this.prefix + 'frmOrder'; this.BTN_TOTAL = this.prefix + 'btnTotal'; this.TXT_OUT = this.prefix + 'txtTotal'; // partial names - Set these according to how the html ids are set this.CHK = this.prefix + 'chk'; this.SEL = this.prefix + 'sel'; this.PRICE = this.prefix + 'txtPrice'; // precision for the decimal places // If not set, then no decimal adjustment is made this.precision = precision ? precision : -1; // if the drop down has the first choice after index 1 // this is used when checking or unchecking a checkbox this.firstChoice = firstChoice ? firstChoice : 1; // **************************** // form this.frm = document.getElementById(this.FORM_NAME); // checkboxes this.chkReg = new RegExp(this.CHK + '([0-9]+)'); this.getCheck = function(chkId) { return document.getElementById(this.CHK + chkId); }; // selects this.selReg = new RegExp(this.SEL + '([0-9]+)'); this.getSelect = function(selId) { return document.getElementById(this.SEL + selId); }; // price spans this.priceReg = new RegExp(this.PRICE + '([0-9]+)'); // text output this.txtOut = document.getElementById(this.TXT_OUT); // button this.btnTotal = document.getElementById(this.BTN_TOTAL); // price array this.prices = new Array(); var o = this; this.getCheckEvent = function() { return function() { o.checkRetotal(o, this); }; }; this.getSelectEvent = function() { return function() { o.totalCost(o); }; }; this.getBtnEvent = function() { return function() { o.totalCost(o); }; }; /* * Calculate the cost * * Required: * Span tags around the prices with IDs formatted * so each item's numbers correspond its select elements and input checkboxes. */ this.totalCost = function(orderObj) { var spanObj = orderObj.frm.getElementsByTagName('span'); var total = 0.0; for (var i=0; i<spanObj.length; i++) { var regResult = orderObj.priceReg.exec(spanObj.id); if (regResult) { var itemNum = regResult[1]; var chkObj = orderObj.getCheck(itemNum); var selObj = orderObj.getSelect(itemNum); var price = orderObj.prices[itemNum]; var quantity = 0; if (selObj) { quantity = parseFloat(selObj.options[selObj.selectedIndex].text); quantity = isNaN(quantity) ? 0 : quantity; if (chkObj) chkObj.checked = quantity; } else if (chkObj) { quantity = chkObj.checked ? 1 : 0; } total += quantity * price ; } } if (this.precision == -1) { orderObj.txtOut.value = total + 750 } else { orderObj.txtOut.value = total.toFixed(this.precision); } }; /* * Handle clicks on the checkboxes * * Required: * The corresponding select elements and input checkboxes need to be numbered the same * */ this.checkRetotal = function(orderObj, obj) { var regResult = orderObj.chkReg.exec(obj.id); if (regResult) { var optObj = orderObj.getSelect(regResult[1]); if (optObj) { if (obj.checked) { optObj.selectedIndex = orderObj.firstChoice; } else { optObj.selectedIndex = 0; } } orderObj.totalCost(orderObj); } }; /* * Set up events */ this.setEvents = function(orderObj) { var spanObj = orderObj.frm.getElementsByTagName('span'); for (var i=0; i<spanObj.length; i++) { var regResult = orderObj.priceReg.exec(spanObj.id); if (regResult) { var itemNum = regResult[1]; var chkObj = orderObj.getCheck(itemNum); var selObj = orderObj.getSelect(itemNum); if (chkObj) { chkObj.onclick = orderObj.getCheckEvent(); } if (selObj) { selObj.onchange = orderObj.getSelectEvent(); } if (orderObj.btnTotal) { orderObj.btnTotal.onclick = orderObj.getBtnEvent(); } } } }; this.setEvents(this); /* * * Grab the prices from the html * Required: * Prices should be wrapped in span tags, numbers only. */ this.grabPrices = function(orderObj) { var spanObj = orderObj.frm.getElementsByTagName('span'); for (var i=0; i<spanObj.length; i++) { if (orderObj.priceReg.test(spanObj.id)) { var regResult = orderObj.priceReg.exec(spanObj.id); if (regResult) { orderObj.prices[regResult[1]] = parseFloat(spanObj.innerHTML); } } } }; this.grabPrices(this); }