<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1141" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=Arial size=2>this works for what i want,
thanks.....</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>pop-up window code:</FONT></DIV>
<DIV><FONT face=Arial
size=2>-------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial
size=2> opener.#attributes.formName#.optTxt.value =
optTxt;<BR> opener.#attributes.formName#.optVal.value =
optVal;<BR> opener.addSelect(optTxt,optVal);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>opener window code:</FONT></DIV>
<DIV><FONT face=Arial
size=2>------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2> function addSelect(newTxt, newVal)
{<BR> newOption = new Option(newTxt, newVal, false,
false);<BR> document.#formName#.#elemName#.options[document.#formName#.#elemName#.length]
= newOption;<BR> }</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>same damn code really... i just moved the
code that adds the new index to the parent page...</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>thanks again....</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT><BR><FONT face=Arial size=2>~ Terry<BR>757
581-5981<BR>AIM/Yahoo: lv2bounce</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>----- Original Message ----- </FONT>
<DIV><FONT face=Arial size=2>From: "Terry" <</FONT><A
href="mailto:bader@tcbader.com"><FONT face=Arial
size=2>bader@tcbader.com</FONT></A><FONT face=Arial size=2>></FONT></DIV>
<DIV><FONT face=Arial size=2>To: "[JavaScript List]" <</FONT><A
href="mailto:javascript@LaTech.edu"><FONT face=Arial
size=2>javascript@LaTech.edu</FONT></A><FONT face=Arial size=2>></FONT></DIV>
<DIV><FONT face=Arial size=2>Sent: Tuesday, March 25, 2003 11:16 AM</FONT></DIV>
<DIV><FONT face=Arial size=2>Subject: Re: [Javascript] adding Option to an
opener.form.select</FONT></DIV></DIV>
<DIV><FONT face=Arial><BR><FONT size=2></FONT></FONT></DIV><FONT face=Arial
size=2>> thanks... gives me some ideas... time to play...<BR>>
<BR>> ~ Terry<BR>> 757 581-5981<BR>> AIM/Yahoo: lv2bounce<BR>>
<BR>> <BR>> ----- Original Message -----<BR>> From: "David T. Lovering"
<</FONT><A href="mailto:dlovering@gazos.com"><FONT face=Arial
size=2>dlovering@gazos.com</FONT></A><FONT face=Arial size=2>><BR>> To:
"[JavaScript List]" <</FONT><A href="mailto:javascript@LaTech.edu"><FONT
face=Arial size=2>javascript@LaTech.edu</FONT></A><FONT face=Arial
size=2>><BR>> Sent: Tuesday, March 25, 2003 11:15 AM<BR>> Subject: Re:
[Javascript] adding Option to an opener.form.select<BR>> <BR>> <BR>>
><BR>> > Well, I've used this between remotes and the parent window
(thereby making<BR>> all the inheritance Nazis jump up and down) by simply
prefacing the<BR>> directive with 'window.opener'. Obviously, if you
have multiple forms<BR>> you'll have to use more inventive means<BR>> >
of addressing them, such as 'window.opener.document.forms["myForm2"]' or<BR>>
whatever. It will get even more complicated if you have multiple forms
AND<BR>> multiple frames, for you'll have to address the frame first before
you can<BR>> hook on to the form.<BR>> ><BR>> > One way to avoid
exercising the inheritance Nazis quite so much is to<BR>> create a function
native to the remote/parent window which adds the option<BR>> you need.
Then you can play the 'remote' game --<BR>> ><BR>> >
window.opener.document.forms["myForm2].addNewOption("nifty");<BR>>
><BR>> > where addNewOption is a function defined within the same page
you are<BR>> trying to change. Obviously, if you are working from the
parent window to a<BR>> child window, all you have to do is dispense with the
'opener' directive,<BR>> and use<BR>> ><BR>> >
winID.document.forms["myForm2"].addNewOption("nifty");<BR>> ><BR>> >
where winID is the window identifier created when the child window was<BR>>
spawned originally.<BR>> ><BR>> > Many variations are
possible, and the pitfalls you experience will<BR>> depend on the
architecture of how your frames, forms, and child windows are<BR>>
linked. I won't pretend that this will solve all your problems<BR>>
straight-away, but it may give you some<BR>> > notions. If you want
to poke me again with a more explicit architectural<BR>> relationship of how
your various bits fit together, I'll be glad to look<BR>> into it.<BR>>
><BR>> > [Depending on how tightly meshed your code is, you
may have to<BR>> dereference to 'parent' or 'top' in order to get the various
bits to see<BR>> each other].<BR>> ><BR>> > -- Dave
Lovering<BR>> ><BR>> > Terry wrote:<BR>> > ><BR>> >
> thanks, but using the forms[x] is out of the question as other
forms<BR>> maybe<BR>> > > added in areas previous to the this
dynamically... and your example<BR>> > > addresses a select in
the current document and not the opener in which i<BR>> am<BR>> > >
having the problems...<BR>> > ><BR>> > > and as for the other
info, i know what the function definition is for<BR>> > > option() and
how to develop for my audience... what i need is a second<BR>>
look<BR>> > > at previous code to see if i missed something... or
to see if this is a<BR>> > > know bug/problem...<BR>> >
><BR>> > > i tried adding .options[length] to the intialization of
the new index<BR>> but<BR>> > > that still crashed it... even
removed the 3rd and 4th arguments in the<BR>> new<BR>> > > option()
declaration... still the same... everything so far leads to a<BR>> > >
crashed browser (IE)...<BR>> > ><BR>> > > the problem i think
is browser based when adding options to select<BR>> objects<BR>> > >
in the opener, everytime it tries to set something in the opener
select<BR>> for<BR>> > > which an index doesnt not exist it
crashes... however, when just<BR>> updating a<BR>> > > current
index value it works fine, but that means one of my options is<BR>> > >
overridden....<BR>> > ><BR>> > > so i am now working on a
work-around.... was hoping someone had more<BR>> > > constructive
data on this problem with a select in the opener...<BR>> > ><BR>>
> > and as for your "ranting", i would leave that to the other lists
to<BR>> > > debate...<BR>> > ><BR>> > >
thanks....<BR>> > ><BR>> > > ~ Terry<BR>> > > 757
581-5981<BR>> > > AIM/Yahoo: lv2bounce<BR>> > ><BR>> >
> ----- Original Message -----<BR>> > > From: "David T. Lovering"
<</FONT><A href="mailto:dlovering@gazos.com"><FONT face=Arial
size=2>dlovering@gazos.com</FONT></A><FONT face=Arial size=2>><BR>> >
> To: "[JavaScript List]" <</FONT><A
href="mailto:javascript@LaTech.edu"><FONT face=Arial
size=2>javascript@LaTech.edu</FONT></A><FONT face=Arial size=2>><BR>> >
> Sent: Tuesday, March 25, 2003 10:34 AM<BR>> > > Subject: Re:
[Javascript] adding Option to an opener.form.select<BR>> > ><BR>>
> > ><BR>> > > > Ugh! Cold-Fusion (even the latest
and greatest version) is a poor<BR>> > > substitute for good solid PHP,
Java, and JavaScript coding. Its<BR>> features<BR>> > > are
chaotic, non-orthogonal, and integrate very poorly with other<BR>>
packages,<BR>> > > and have all sorts of inheritance<BR>> > >
> issues which will drive you mad eventually. [And let us not
forget<BR>> that<BR>> > > it is God-awful slow, has huge latency
problems, and sucks screen and<BR>> CPU<BR>> > > resources]. The
only people who like it are newbies who think they only<BR>> have<BR>>
> > to learn one "language" to make<BR>> > > > everything they
want done happen without any downsides.<BR>> > > > Enough
ranting.<BR>> > > ><BR>> > > > The method I use for
adding to a pre-existing select widget is as<BR>> > > follows
--<BR>> > > ><BR>> > > > var myMenu =
document.forms[0].mySelect;<BR>> > > >
myMenu.options[myMenu.length] = new Option("bogus", "bogus-value");<BR>> >
> ><BR>> > > > Obviously, you can insert the other two Option
parameters if you wish<BR>> [the<BR>> > > third controls the default
selection, and the fourth determines whether<BR>> this<BR>> > > item
is selected for the moment], but I usually leave that to my 'init'<BR>> >
> routine to work out.<BR>> > > ><BR>> > > > Although
the DOM model certainly encourages you to believe that the<BR>> > >
universal constructor assignments are 100% viable, I've had problems<BR>>
with<BR>> > > them, particularly in computing environments with diverse
browsers,<BR>> OS's,<BR>> > > and such like. You are welcome
to try<BR>> > > > them of course (and many are very useful), but be
sure to vet them for<BR>> all<BR>> > > the platforms you expect to
have exercising your code.<BR>> > > ><BR>> > > > -- Dave
Lovering<BR>> > > ><BR>> > > ><BR>> > >
><BR>> > > ><BR>> > > > Terry wrote:<BR>> >
> > code<BR>> > > >
-------------------------------------------<BR>> > > > newOption =
new Option(optTxt, optVal, 0, 1);<BR>> > > ><BR>> >
><BR>>
opener.#attributes.formName#.#attributes.elem#[opener.#attributes.formName#.<BR>>
> > #attributes.elem#.length] = newOption;<BR>> > > ><BR>>
> > ><BR>> > > > ok, able to read values from the
opener.form.select using the same<BR>> syntax<BR>> > > as above but
i cannot seem to add a new option...<BR>> > > ><BR>> > >
> btw, the ## are CF variables, just assume that attributes.formName
is<BR>> the<BR>> > > name of the form from opener and
attributes.elem is the name of the<BR>> select<BR>> > >
object......<BR>> > > ><BR>> > > > comments??<BR>>
> > ><BR>> > > ><BR>> > > > ~ Terry<BR>>
> > > 757 581-5981<BR>> > > > AIM/Yahoo: lv2bounce<BR>>
> > > _______________________________________________<BR>> > >
> Javascript mailing list<BR>> > > > </FONT><A
href="mailto:Javascript@LaTech.edu"><FONT face=Arial
size=2>Javascript@LaTech.edu</FONT></A><BR><FONT face=Arial size=2>> >
> > </FONT><A
href="https://lists.LaTech.edu/mailman/listinfo/javascript"><FONT face=Arial
size=2>https://lists.LaTech.edu/mailman/listinfo/javascript</FONT></A><BR><FONT
face=Arial size=2>> > > ><BR>> > ><BR>> > >
_______________________________________________<BR>> > > Javascript
mailing list<BR>> > > </FONT><A
href="mailto:Javascript@LaTech.edu"><FONT face=Arial
size=2>Javascript@LaTech.edu</FONT></A><BR><FONT face=Arial size=2>> >
> </FONT><A href="https://lists.LaTech.edu/mailman/listinfo/javascript"><FONT
face=Arial
size=2>https://lists.LaTech.edu/mailman/listinfo/javascript</FONT></A><BR><FONT
face=Arial size=2>> >
_______________________________________________<BR>> > Javascript mailing
list<BR>> > </FONT><A href="mailto:Javascript@LaTech.edu"><FONT face=Arial
size=2>Javascript@LaTech.edu</FONT></A><BR><FONT face=Arial size=2>> >
</FONT><A href="https://lists.LaTech.edu/mailman/listinfo/javascript"><FONT
face=Arial
size=2>https://lists.LaTech.edu/mailman/listinfo/javascript</FONT></A><BR><FONT
face=Arial size=2>> ><BR>> <BR>> <BR>>
_______________________________________________<BR>> Javascript mailing
list<BR>> </FONT><A href="mailto:Javascript@LaTech.edu"><FONT face=Arial
size=2>Javascript@LaTech.edu</FONT></A><BR><FONT face=Arial size=2>>
</FONT><A href="https://lists.LaTech.edu/mailman/listinfo/javascript"><FONT
face=Arial
size=2>https://lists.LaTech.edu/mailman/listinfo/javascript</FONT></A><BR><FONT
face=Arial size=2>> </FONT></BODY></HTML>