Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a variable passed to a function in the FORM access string.

Status
Not open for further replies.

Triton001

Programmer
Jan 17, 2002
8
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top