Hi,
I'm trying to pass a PHP variable into a function and use it in the element section of the DOM access string.
It's not as simple as just passing a variable to a function.
Example:
function calcext(price,boxname)
{
var exttotal = document.order.boxname.value * price
document.order.extTot0.value = format(exttotal,2);
}
The vaiable price is coming through fine, but the variable boxname is comming through as an object and not as the text it should be. The value in the boxname variable is being passed from an onblur event handler and is simple text. I want to insert the text into the following string:
document.order.boxname.value so it reads something like this
document.order.NQ000.value Where NQ000 is the value of the variable boxname.
Can anyone help me with this?
Mike
mikecook@net-ins.com
I'm trying to pass a PHP variable into a function and use it in the element section of the DOM access string.
It's not as simple as just passing a variable to a function.
Example:
function calcext(price,boxname)
{
var exttotal = document.order.boxname.value * price
document.order.extTot0.value = format(exttotal,2);
}
The vaiable price is coming through fine, but the variable boxname is comming through as an object and not as the text it should be. The value in the boxname variable is being passed from an onblur event handler and is simple text. I want to insert the text into the following string:
document.order.boxname.value so it reads something like this
document.order.NQ000.value Where NQ000 is the value of the variable boxname.
Can anyone help me with this?
Mike
mikecook@net-ins.com