Name: jimg Date: December 5, 2007 at 14:19:10 Pacific Subject: Indirect assignments in javascript OS: 2003 Server CPU/Ram: 3g P4, 4gb Model/Manufacturer: Asus
Comment:
I have a form text box that I need to load, but the name of the field is a variable (quan1, quan2, etc.). The following code results in a blank alert and the box remains empty. I think I've tried all the simpler combinations. Any suggestions?
function spcfnc(x,value) { setVar('window.order.quan'+x,value) alert(eval('window.order.quan'+x).value) } function setVar(y,z){ y.value = z; }
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE