Hi, cant get this function to work how it should, if the days (var Diff)are less then 27 then textbox id="alow" should be the days * 100 . if the days are greater than 27 then its Math.round((Diff / 7) * 500). but if the price = 420 or 450 then it should be 2000 .. its probably something small and stupid ive missed. thanks in advanced
Code:
if (Diff < 28 && document.date.car.options[document.date.car.selectedIndex].value=="A" && document.date.rentalamount.value === "£420" || "£450" )
{
document.date.alow.value = "2000 Miles"
}
else if (Diff < 28)
{
document.date.alow.value = Diff * 100 +" Miles"
}
else (Diff > 27 && document.date.car.options[document.date.car.selectedIndex].value=="A")
{
document.date.alow.value = Math.round((Diff / 7) * 500)
}