below is the source code for my simple product cataloge using JAVASCRIPT.. & its giving me error... can anyone help me out.. pls..
<html>
<head>
<title> Product cataloge</title>
<script language="javascript">
funtion autocalc()
{
document.all.item("total"
.value ="$ 0.00";
document.all.item("total1"
.value = (document.all.item("price1"
.value * document.all.item("qty"
.value);
document.all.item("total2"
.value = (document.all.item("price2"
.value * document.all.item("qty1"
.value);
document.all.item("total3"
.value = (document.all.item("price3"
.value*document.all.item("qty2"
.value);
document.all.item("total4"
.value = (document.all.item("price4"
.value*document.all.item("qty3"
.value);
document.all.item("total5"
.value = (document.all.item("price5"
.value*document.all.item("qty4"
.value);
document.all.item("total6"
.value = (document.all.item("price6"
.value*document.all.item("qty5"
.value);
document.all.item("total"
.value=(document.all.item("total1"
.value + document.all.item("total2"
.value +
document.all.item("total3"
.value + document.all.item("total4"
.value + document.all.item("total5"
.value +
document.all.item("total6"
.value);
document.all.item("sub_total"
= document.all.item("total"
+ (document.all.item("total"
* 0.05);
}
</script></head>
<body bgcolor= "#ff9999"onload="">
<b>Product cataloge for the Course of "Studies of Social Information".</b>
</body>
<form action=/cgi-bin/gdw1J23.cgi method=POST name="Product cataloge">
<input type="hidden"name="theme" value="Product Cataloge">
<input type="hidden"name="author" value="prasogu1">
Product:<input name="prod1" type=text size="20"value="Product name"></input> Quantity:<input name="qty" type=text
size="20"value="0" onchange="autocalc();"></input> Price:<input name="price1" type=text size="20" value="$0.00"
onchange="autocalc();"></input> Total:<input name="total1" type=text size="20"value="$0.00" readonly></input><br />
Product:<input name="prod2" type=text size="20"value="Product name"></input> Quantity:<input name="qty1" type=text
size="20"value="0" onchange="autocalc();"></input> Price:<input name="price2" type=text size="20" value="$0.00"
onchange="autocalc();"></input> Total:<input name="total2" type=text size="20"value="$0.00" readonly></input><br />
Product:<input name="prod3" type=text size="20"value="Product name"></input> Quantity:<input name="qty2" type=text
size="20"value="0" onchange="autocalc();"></input>Price:<input name="price3" type=text size="20" value="$0.00"
onchange="autocalc();"></input> Total:<input name="total3" type=text size="20"value="$0.00" readonly></input><br />
Product:<input name="prod4" type=text size="20"value="Product name"></input> Quantity:<input name="qty3" type=text
size="20"value="0" onchange="autocalc();"></input> Price:<input name="price4" type=text size="20" value="$0.00"
onchange="autocalc();"></input> Total:<input name="total4" type=text size="20"value="$0.00" readonly></input><br />
Product:<input name="prod5" type=text size="20"value="Product name"></input> Quantity:<input name="qty4" type=text
size="20"value="0" onchange="autocalc();"></input> Price:<input name="price5" type=text size="20" value="$0.00"
onchange="autocalc();"></input> Total:<input name="total5" type=text size="20"value="$0.00" readonly></input><br />
Product:<input name="prod6" type=text size="20"value="Product name"></input> Quantity:<input name="qty5" type=text
size="20"value="0" onchange="autocalc();"></input> Price:<input name="price6" type=text size="20" value="$0.00"
onchange="autocalc();"></input> Total:<input name="total6" type=text size="20"value="$0.00" readonly></input><br />
Sub Total:<input name="total" type=text size="20"value="$0.00" readonly></input><br />
Total:<input name="sub_total" type=text size="20"value="$0.00" readonly></input><br />
<input type ="button" name= "Calculate" value="Calulate" onclick="autocalc();" /><br />
<input type ="submit" /><br />
</form>
</html>
thanks prasoon
<html>
<head>
<title> Product cataloge</title>
<script language="javascript">
funtion autocalc()
{
document.all.item("total"
document.all.item("total1"
document.all.item("total2"
document.all.item("total3"
document.all.item("total4"
document.all.item("total5"
document.all.item("total6"
document.all.item("total"
document.all.item("total3"
document.all.item("total6"
document.all.item("sub_total"
}
</script></head>
<body bgcolor= "#ff9999"onload="">
<b>Product cataloge for the Course of "Studies of Social Information".</b>
</body>
<form action=/cgi-bin/gdw1J23.cgi method=POST name="Product cataloge">
<input type="hidden"name="theme" value="Product Cataloge">
<input type="hidden"name="author" value="prasogu1">
Product:<input name="prod1" type=text size="20"value="Product name"></input> Quantity:<input name="qty" type=text
size="20"value="0" onchange="autocalc();"></input> Price:<input name="price1" type=text size="20" value="$0.00"
onchange="autocalc();"></input> Total:<input name="total1" type=text size="20"value="$0.00" readonly></input><br />
Product:<input name="prod2" type=text size="20"value="Product name"></input> Quantity:<input name="qty1" type=text
size="20"value="0" onchange="autocalc();"></input> Price:<input name="price2" type=text size="20" value="$0.00"
onchange="autocalc();"></input> Total:<input name="total2" type=text size="20"value="$0.00" readonly></input><br />
Product:<input name="prod3" type=text size="20"value="Product name"></input> Quantity:<input name="qty2" type=text
size="20"value="0" onchange="autocalc();"></input>Price:<input name="price3" type=text size="20" value="$0.00"
onchange="autocalc();"></input> Total:<input name="total3" type=text size="20"value="$0.00" readonly></input><br />
Product:<input name="prod4" type=text size="20"value="Product name"></input> Quantity:<input name="qty3" type=text
size="20"value="0" onchange="autocalc();"></input> Price:<input name="price4" type=text size="20" value="$0.00"
onchange="autocalc();"></input> Total:<input name="total4" type=text size="20"value="$0.00" readonly></input><br />
Product:<input name="prod5" type=text size="20"value="Product name"></input> Quantity:<input name="qty4" type=text
size="20"value="0" onchange="autocalc();"></input> Price:<input name="price5" type=text size="20" value="$0.00"
onchange="autocalc();"></input> Total:<input name="total5" type=text size="20"value="$0.00" readonly></input><br />
Product:<input name="prod6" type=text size="20"value="Product name"></input> Quantity:<input name="qty5" type=text
size="20"value="0" onchange="autocalc();"></input> Price:<input name="price6" type=text size="20" value="$0.00"
onchange="autocalc();"></input> Total:<input name="total6" type=text size="20"value="$0.00" readonly></input><br />
Sub Total:<input name="total" type=text size="20"value="$0.00" readonly></input><br />
Total:<input name="sub_total" type=text size="20"value="$0.00" readonly></input><br />
<input type ="button" name= "Calculate" value="Calulate" onclick="autocalc();" /><br />
<input type ="submit" /><br />
</form>
</html>
thanks prasoon