I'm just finishing off an assignment which required me to build a little form that totals order details etc. It works perfectly fine in Chrome, but I ran a test in Firefox (as the assessors will be using that) and it fails to work at all. Any tips or solutions as to why would be appreciated. Thanks
JavaScript
function list(theform){
var mem = theform.elements["mem"].value;
var cov = theform.elements["cover"].value;
var cha = theform.elements["charger"].value;
var scr = theform.elements["screen"].value;
var del = theform.elements["delivery"].value;
var qty = theform.elements["qty"].value;
acc = (parseInt(mem) + parseInt(cov) + parseInt(cha) + parseFloat(scr) + parseInt(del)) * qty;
total.value = "$" + Math.round(acc*100)/100;
return false;
}
HTML
<form id="accform" onsubmit="return list(this)">
<label class="third column" for="memory">Memory</label>
<label class="third column" for="case">Case</label>
<label class="third column" for="memory">Charger</label>
<select class="third column" id="mem" name="mem">
<option value="0">2GB : No charge</option>
<option value="5">4GB : $5.00</option>
<option value="12">8GB : $12.00</option>
<option value="24">16GB : $24.00</option>
</select>
<select class="third column" id="cover" name="cover">
<option value="0">No case </option>
<option value="4">Leather case : $4.00 </option>
<option value="4">Silicon case : $4.00 </option>
</select>
<select class="third column" id="charger" name="charger">
<option value="0">No charger </option>
<option value="5">Car charger : $5.00 </option>
<option value="6">Car charger holder : $6.00 </option>
</select>
<label class="third column" for="memory">Screen protector</label>
<label class="third column" for="case">Shipping</label>
<div class="full column"></div>
<select class="third column" id="screen" name="screen">
<option value="0">None</option>
<option value="0.99">x1 : $0.99</option>
<option value="1.79">x2 : $1.79</option>
<option value="2.39">x3 : $2.39</option>
<option value="3.40">x5 : $3.40 </option>
</select>
<select class="third column" id="delivery" name="delivery">
<option value="0">Normal shipping : No charge </option>
<option value="35">Expedited Delivery (Fedox) : $35.00</option>
</select>
<div class="full column">
</div>
<label class="third column" for="qty">Quantity</label>
<label class="third column" for="total">Total</label>
<div class="full column">
</div>
<div class="third column">
<input id="qty"/>
</div>
<input class="third column "id="total"/>
<button class="submit">Calculate</button>
<div class="full column">
</div>
</form>