Late last week I asked how to use a popup login window effectively.  Steve gave me a 
starting point and here's what I came up with.
I'm posting it here now, because several people emailed me off list asking that I let 
them know how to do it if I figured it out.
So for anybody interested, here is my solution.  There are probablly much better ones, 
but this one seems to work good.

=========================================

1)  Use JS to name your main window:
        <script language="JavaScript">
            <!-- Begin
                    window.name="myHomeWindow";
            // End -->
        </script>

2)  Use an onMouseOver or onClick event with a target to send info back to main window 
and use a closer to close the popup window:

#####  Place the following in the HEAD of your popup:

<SCRIPT LANGUAGE="javascript">
<!-- Begin
var nifty_little_window = null;
function Login() {
nifty_little_window = window.open(login.cfm', 'loginMaster', 
'width=350,height=275,resizable=1');
}
// End -->
</SCRIPT>

##### Make your link in the body

<A HREF="" onMouseOver="Login()"><IMG SRC="images/yourImage.gif" ALT="Login" 
BORDER="0"></A>
OR
<A HREF="" onClick="Login()"><IMG SRC="images/yourImage.gif" ALT="Login" 
BORDER="0"></A>

~~~ Just be ware that onClick makes your main window refresh because of the blank a 
href value ~~~


3)  Then, on your login form, put a little JS in the FORM Action tag to close the 
window on login:

<CFFORM ACTION="index.cfm" TARGET="myHomeWindow" 
onSubmit="setTimeout('window.close()',2000)">
    ~~ Form Fields Here ~~~
</CFFORM>
=================================================

Works like a charm in NS3, NS4+, IE4+ (didn't test in IE 3)

Dave

=================================
"Always Drink Upstream From The Herd!"

David Hannum
Web Analyst/Programmer
Ohio University
[EMAIL PROTECTED]
(740) 597-2524




------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to