earthsiege
07-17-2004, 03:09 PM
hey ppl,
i mtrying to implement a java scrip as a function which basically gets two numbers from the screen and multiplies them and then places the new
number onto another field. :D
but the ticky thing for me is the fact that the fields that the numbers come from are variable variables eg: product1, product2, product 3 (in a loop where i is incremented <input name='product$i' value='$product>.'
now im trying to do a similar thing is javascript and the code i have come up with is:
function do_math() {
var B = 1
Var num= A;
while (B < num) {
var quantity = eval(document.step5.quantity[B].value)
var price = eval(document.step5.price[B].value)
var calprice = quantity * price
document.step5.cal[B].value= calprice;
}
can anyone help me & btw is this question really really stoopid? :confused:
i mtrying to implement a java scrip as a function which basically gets two numbers from the screen and multiplies them and then places the new
number onto another field. :D
but the ticky thing for me is the fact that the fields that the numbers come from are variable variables eg: product1, product2, product 3 (in a loop where i is incremented <input name='product$i' value='$product>.'
now im trying to do a similar thing is javascript and the code i have come up with is:
function do_math() {
var B = 1
Var num= A;
while (B < num) {
var quantity = eval(document.step5.quantity[B].value)
var price = eval(document.step5.price[B].value)
var calprice = quantity * price
document.step5.cal[B].value= calprice;
}
can anyone help me & btw is this question really really stoopid? :confused: