You code is following:
Code:
document.book.euro.value = document.book.days.value * (floor((document.book.adults.value)/3) * (47+ac) + 41 + ac) ;
Issues
1. Any value that comes from any form field is string by nature especially in your case you are using the value of days form field. Before using the value in a mathematical expression you need to convert the value into number using parseInt or parseFloat methods.
2. You can't call floor function the way you used. It should be like the following. The floor function comes under Math object.
3. You have used a variable named 'ac' make sure that it contains number based value in it.
Assuming that you have proper value in 'ac' variable check the following CODE
Code:
document.book.euro.value = parseFloat(document.book.days.value) * Math.floor(document.book.adults.value / 3) * (47 + ac) + 41 + ac;
Bookmarks