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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Paaing variables

Status
Not open for further replies.

Gaylord

Technical User
Sep 26, 2002
49
0
0
DE
Hi,

I am a little new to all this and am currently tearing my hair out.

I have a function that needs to be called multiple times and looks like....

function LoadInc(theField)
{
inctxt = new Array();
inctxt[0] = new Array; inctxt[0][0] = ''
inctxt[0][1] = '10'
inctxt[0][2] = '11'
inctxt[0][3] = '12'
inctxt[0][4] = '13'
inctxt[0][5] = '14'


for (i=0; i<inctxt.length; i++) {
alert("test")
document.IATeleform.theField.options.length = inctxt[0].length;
total = inctxt[0].length;
alert("Total = " + total)
}

for (n=0; n<total; n++) {
document.IATeleform.theField.options[n].text = inctxt[0][n];
}

}

This doesn't work! But when I actually use the proper fields name instead of "theField" it works fine. Any ideas how to resolve this or am I missing something.

Thanks

Jamie
 
Instead of using this:

Code:
document.IATeleform.theField.

use this:

Code:
document.forms['IATeleform'].elements[theField].

Hope this helps,
Dan
 
Thanks Dan.

Works a treat!

Cheers

Jamie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top