hi, as the title has saiad, if the user click "ok" for exp it will link to www.google.com and if the user click "cancel" it will link to www.yahoo.com.
below is my code
function calcFunc(){
var val1 = document.calcForm.selectQuantity1.selectedIndex;
var val2 = document.calcForm.selectQuantity2.selectedIndex;
var val3 = document.calcForm.selectQuantity3.selectedIndex;
var val4 = document.calcForm.selectQuantity4.selectedIndex;
var val5 = document.calcForm.selectQuantity5.selectedIndex;
var val6 = document.calcForm.selectQuantity6.selectedIndex;
if (document.calcForm.selectQuantity1.selectedIndex != 0 || document.calcForm.selectQuantity2.selectedIndex != 0
|| document.calcForm.selectQuantity3.selectedIndex != 0 || document.calcForm.selectQuantity4.selectedIndex != 0
|| document.calcForm.selectQuantity5.selectedIndex != 0 || document.calcForm.selectQuantity6.selectedIndex != 0){
var amt = (49.0 * (val1+val2+val3+val4+val5+val6));
document.write(ConfirmChoice(amt))
}
}
//Comfirm Function
function ConfirmChoice(answer)
{
answer1 = confirm("Your total is RM" + answer + "\nProceed to the payment site?");
if (answer1!="1")
{
window.location="http:\\www.google.com";
}
else
{
window.location="TShirt.html";
}
}