Put a <form> with a name around your <table>, like ...
<form name="myForm">
... Your table ...
</form>
Then, refer to S1 like this:
document.myForm.S1
Or, if you don't care about Netscape 4.x or some other browsers besides IE,
you could use these to get a reference to S1:
document.all("S1")
document.getElementById("S1")
getElementById should also work in Mozilla and Netscape 6+.
HTH,
Greg
-----Original Message-----
From: Mario Descalzi [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 3:51 PM
To: [EMAIL PROTECTED]
Subject: [wdvltalk] Array Index
Hello,
This is my function.
function get_reten()
{
var ret;
var Rete_Fte = new Array("A","B","C","D","E","F","G","H","I","J");
var Val_Rete_Fte = [5,1,5,1,1,1,1,5,1,1];
hnd =
window.open("","Caption","width=460,height=100,modal=no,dependent=yes,status
=no,resizable=no");
hnd.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
Transitional//EN">');
hnd.document.write('<HTML><HEAD><TITLE>Title</TITLE></HEAD>');
hnd.document.write('<BODY onblur="self.focus()">');
hnd.document.write('<table border="1" style="{background: green;
color: lightgreen;}">');
hnd.document.write('<tr><td>Lable No. 1</td>');
hnd.document.write('<td><select name="S1" size=1>');
for(ret=0; ret < Rete_Fte.length; ret++)
hnd.document.write('<option
value='+Rete_Fte[ret]+'>'+Rete_Fte[ret]+'');
hnd.document.write('</select></td></tr>');
hnd.document.write('<tr><td colspan="2"
align="center">Accept <input type="button" value=""
style="{background: lightgreen;}"
onClick="window.opener.document.F3.RetF.value='+Val_Rete_Fte[S1.selectedInde
x]+'"></td>');
hnd.document.write('</table>');
hnd.document.write('</BODY></HTML>');
hnd.focus();
}
I'm tying to pass back to the caller window a value from the Val_Rete_Fte
array which is the same index as the Rete_Fte array shown in the select drop
down list. The statement: '+Val_Rete_Fte[S1.selectedIndex]+' returns with
an "Undefined S1" and have tried document.S1 and hnd.document.S1; all with
the same result. Could any one hint me in the right direction?
Thanks,
Mario.
The information in this electronic mail message is sender's business
Confidential and may be legally privileged. It is intended solely for the
addressee(s). Access to this Internet electronic mail message by anyone
else is unauthorized. If you are not the intended recipient, any
disclosure, copying, distribution or any action taken or omitted to be taken
in reliance on it is prohibited and may be unlawful.
The sender believes that this E-mail and any attachments were free of any
virus, worm, Trojan horse, and/or malicious code when sent. This message and
its attachments could have been infected during transmission. By reading
the message and opening any attachments, the recipient accepts full
responsibility for taking protective and remedial action about viruses and
other defects. Galileo International is not liable for any loss or damage
arising in any way from this message or its attachments.
____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED]
Send Your Posts To: [EMAIL PROTECTED]
To change subscription settings to the wdvltalk digest version:
http://wdvl.internet.com/WDVL/Forum/#sub
________________ http://www.wdvl.com _______________________
You are currently subscribed to wdvltalk as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]