hi, i'm doing a shopping cart where by when user add a product in cart, it will show the qty, item name, and price.

i want to use javascript to do it in a way tat when i change the qty, the price will change also.

for eg, i type 2 in the text field of the qty, then my price will change to original price * 3.

i keep getting error with the javacript below. hope can get help here.

this is the javascript:
Code:
<script language="JavaScript">
<!--
function changevalue()
{	

orivalue = document.form.our_price.value;
qtyvalue = document.form.qty.value;
	
newvalue = orivalue * qtyvalue;
document.form.amount.value = newvalue;
	
//-->
}
</script>
and my text fields are like below..(part of my codes)
PHP Code:
echo "<form method=post action=user_cart.php name=form>";
echo 
"<input type=hidden name=our_price value=$our_price>\n";
echo 
"<tr><td width=5% align=center><input type=text name=qty value=\"$qty\" size=2 class=ft1 onKeyPress=\"changevalue()\"></td>";
echo 
"<td width=15% align=center><input type=text name=amount value=\"$amount\" class=ft1></td>"
pls help me...thanks.