I am trying to write a function that can be used by a number of diiferent sections of code. Here is what I haveThen I call it withCode:function update(numb) { var x; var box = new Array(); box[1] = "price1"; ttl = document.forms["product"].box[numb].value; document.forms["product"].total = ttl; }The problem is that it doesn't work. If I change this lineCode:<input type="text" id="price1" onkeyup="update(1)">toCode:ttl = document.forms["product"].box[numb].value;then it works. Can anyone please point out my mistake?Code:ttl = document.forms["product"].price1.value;



Reply With Quote


Bookmarks