Name: Anonymous 2008-03-04 14:44
BAWWWWWWWWWWWWWWWWWWW
Why the hell wont my function work when called????
<script type="text/javascript">
function calcTotal(){
var extra1 = 0;
var extra2 = 0;
var extra3 = 0;
var option1 = 0;
var total = 0;
//check to see which option button is checked
if (document.details.optionGroup[0].checked {
option1 = document.details.optionGroup[0].value
}
else if (document.details.optionGroup[1].checked {
option1 = document.details.optionGroup[1].value
}
else if (document.details.optionGroup[2].checked {
option1 = document.details.optionGroup[2].value
}
else
{
option = 0;
}
//check to see which checkboxes are checked
if (document.details.extra1.checked){
extra1=150;
}//end of if
if (document.details.extra2.checked){
extra2=100;
}//end of if
if (document.details.extra3.checked){
extra3=250;
}//end of if
total =parseInt(option1) + parseint(extra1) + parseInt(extra2) + parseInt(extra3);
incvat=Math.round((total/100)*121);
document.details.exvat.value = total;
document.details.incvat.value = incvat;
}//End of calcTotal Function
Why the hell wont my function work when called????
<script type="text/javascript">
function calcTotal(){
var extra1 = 0;
var extra2 = 0;
var extra3 = 0;
var option1 = 0;
var total = 0;
//check to see which option button is checked
if (document.details.optionGroup[0].checked {
option1 = document.details.optionGroup[0].value
}
else if (document.details.optionGroup[1].checked {
option1 = document.details.optionGroup[1].value
}
else if (document.details.optionGroup[2].checked {
option1 = document.details.optionGroup[2].value
}
else
{
option = 0;
}
//check to see which checkboxes are checked
if (document.details.extra1.checked){
extra1=150;
}//end of if
if (document.details.extra2.checked){
extra2=100;
}//end of if
if (document.details.extra3.checked){
extra3=250;
}//end of if
total =parseInt(option1) + parseint(extra1) + parseInt(extra2) + parseInt(extra3);
incvat=Math.round((total/100)*121);
document.details.exvat.value = total;
document.details.incvat.value = incvat;
}//End of calcTotal Function