I am trying to add the total for some drop down list but am having trouble referencing the value, I just keep on getting a value. The code however works perfectly in IE and Netscape 6.
Here is my code:
<javascript>
function PriceUpdate(whichbox) {
with (whichbox.form) {
alert(whichbox.value);//this gives me null all the time
if (whichbox.selected == false)
hiddentotal.value = eval(hiddentotal.value) - eval(whichbox.value);
else
hiddentotal.value = eval(hiddentotal.value) + eval(whichbox.value);
return(formatCurrency(hiddentotal.value));
}
}
</javascript>
<select name="Acc" size="1" onChange="this.form.total.value=PriceUpdate(this);">
<option VALUE="">Not Required</option>
<option value="135.00">Protein Structure Analysis </option>
<option value="320.00">FULL Registration</option>
</script>
Come someone please help me.
Thanx
Richard
Here is my code:
<javascript>
function PriceUpdate(whichbox) {
with (whichbox.form) {
alert(whichbox.value);//this gives me null all the time
if (whichbox.selected == false)
hiddentotal.value = eval(hiddentotal.value) - eval(whichbox.value);
else
hiddentotal.value = eval(hiddentotal.value) + eval(whichbox.value);
return(formatCurrency(hiddentotal.value));
}
}
</javascript>
<select name="Acc" size="1" onChange="this.form.total.value=PriceUpdate(this);">
<option VALUE="">Not Required</option>
<option value="135.00">Protein Structure Analysis </option>
<option value="320.00">FULL Registration</option>
</script>
Come someone please help me.
Thanx
Richard