I have a order form that adds up all the input boxes (45) and then totals them using function updatePrice() (which works) I’m trying to have the output as XX.XX and can’t figure out how to get the number from the id=”txtTotal” into the function round() and return the formatted number to “txtTotal”.
thanks for your time
jim
thanks for your time
jim
Code:
<script> function updatePrice(){ { } var AZ115R=(document.getElementById('frmOrder').sel0.options[document.getElementById('frmOrder').sel0.selectedIndex].value)*5.40; var AZ115R1=(document.getElementById('frmOrder').sel0a.options[document.getElementById('frmOrder').sel0a.selectedIndex].value)*5.15; var AZ115R2=(document.getElementById('frmOrder').sel0b.options[document.getElementById('frmOrder').sel0b.selectedIndex].value)*4.90; document.getElementById('txtTotal').value=AZ115R + AZ115R1 + AZ115R2; } </script> <head> </head> <body> <form name="form1" action="http://www.bluehost.com/bluemail" enctype="multipart/form-data" method="POST" class="style2" id="frmOrder"> <table border="0" width="701"> <tr> <td width="6"> </td> <td> <img border="0" src="AZ115.JPG" width="129" height="85"></font></td> <td><font color="#CCCCCC"><input type="text" name="AZ115R" value="1AZ115R - Sedona Shrimp" size="35"></font></td> <td> <font color="#CCCCCC"> <input type="text" value="$5.40" size="5" name="T2"></font></td> <td><font color="#CCCCCC"><select name="select1" id="sel0" name="sel0"> <option value="0">00</option> <option value="1">01</option> <option value="2">02</option> <option value="3">03</option> <option value="4">04</option> <option value="5">05</option> </select></font></td> <td><font color="#CCCCCC"><select name="select2" id="sel0a" name="sel0a"> <option value="0">00</option> <option value="6">06</option> <option value="7">07</option> <option value="8">08</option> <option value="9">09</option> <option value="10">10</option> <option value="11">11</option> </select></font></td> <td> <font color="#CCCCCC"> <select name="select3" id="sel0b" name="sel0b"> <option value="0">00</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> </select></font></td> <font color="#CCCCCC"> <input name="data" type="button" value="Click for Total of Order" onclick="updatePrice()"> $<input type="text" value="0" name="total order" id="txtTotal" size="8" /> </font> </body>
Comment