I wrote it but but something goes wrong and I'm already lost!
It is part of an online payment form. Depending on your choice, the price must be displayed immediately. If the user changes selection - price will change too. Not buttons. Only events.
I used only one tool to recover data value. I used innerHTML to place data into a span tag.
But I displays NaN, although I used parseInt ...
Can anyone explain where I'm wrong?
Thanks!
(I isolated select3 because the function does not work )
<!-- -->
<html>
<head>
<title>Buyer form </title>
<script langage="javascript" type="text/javascript">
function caclulatePrice()
{
var select1, select2, select3, select4, select5, totalPrice;
totalPrice = 0;
for (var i=0; i < document.formSell.thirdProduct.length; i++)
{
if (document.formSell.thirdProduct[i].checked)
{
var y = document.formSell.thirdProduct[i].value;
}
}
*/
//select4
if (document.formSell.fourthProduct.checked == 1)
{
select4 = parseInt(document.getElementById("4-thProduct").value)
}
Bookmarks