Depends on what exactly you want to do with the value 
in the caller; but you can access the variables that exist
in the caller (opener) directly via the opener object 
itself. The opener object represents the window object
of the caller. Thus in your example you access the form 
in the caller using opener:

window.opener.document.frm.state_user.value = etc.

You could also access other variables in the caller using the
opener object; i.e., if you have this, for example, in 
the caller:

<script language=JavaScript>
<!--
   var foo="myFoo";
// -->
</script>
<a href="javascript:alert(foo)">Show foo</a>

then within the page you open via window.open you
can set foo of the caller via:

window.opener.foo="myBar";

IOW, you can access the variables and objects of the caller 
using opener in the same way you would access them using 
window from within the caller itself. I'm typing this all 
from memory, but hopefully it's close enough to get you 
going. You may run into security precautions if the called
window loads a page from a different domain; can't remember
all the details on that off the top of my head. 

Dan Ragle

> -----Original Message-----
> From: Philippe Levy [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 13, 2001 12:25 PM
> To: Ben Ausden; [EMAIL PROTECTED]
> Subject: Re: [htmltmpl] HTML paramater in form
> 
> 
> nope not at all. I'm not talking of HTML::Template.
> 
> I have for example
> 
> <HTML>
> etc
> function popUp(url,w,h,scroll)
> {
> 
> window.open(url,\"win\",'toolbar=0,location=0,directories=0,status=0,menubar
> =0,scrollbars=' +
> scroll + ',resizable=0,width=' + w + ',height=' + h + ',top=20,left=20');
> }
> 
> then somewhere in my html I have this
> <a href=\"javascript:void(0);\"
> onClick=\"popUp('$ip_html/tc_locator.php',600,600,'1');\">
> 
> in the window that pops up I ask some questions for example a state.
> When the user chooses a state I'll do this.
> <a href="#"
> onClick="window.opener.document.frm.state_user.value=document.frm.state.opti
> ons[document.frm.state.selectedIndex].value;self.close();">
> 
> but in order to do this I need to have a state_user <input type="text">
> 
> ----- Original Message -----
> From: "Ben Ausden" <[EMAIL PROTECTED]>
> To: "'Philippe Levy'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Thursday, September 13, 2001 12:17 PM
> Subject: RE: [htmltmpl] HTML paramater in form
> 
> 
> 
> > I know this is for the HTML::Tmpl mailing list but I need
> > help with HTML.
> >
> > I have a main page wich calls a pop-up window. In the pop-up
> > the user needs to make some choices. These choices need to be
> > returned to the calling page. This works fine when assignig
> > to an input type in the form the value of the chosen
> > parameter. But How do you get this to work when you are not
> > using <input type="text" name="field" value="none"> but are
> > simlly printing the value.???
> 
> Not quite sure what you mean, but you can use VARs twice, for example:
> 
> Foo: <TMPL_VAR NAME="bar">
> 
> <form etc.>
> <input type="hidden" name="foo" value="<TMPL_VAR NAME=bar>">
> </form>
> 
> will display the value and also populate a hidden form variable
> 
> Is that what you meant?
> 
> rgds,
> ben
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to