Popup window loses focus alert

C

Colin Graham

Hi there,

i want to create a piece of javascript that checks to see if a popup
window is open when the user clicks on the main form. If the popup is
open it will set focus back to the popup and display an alert message.

im not sure of the event to use on the main form to call the function
or how to write the function.

any help greatly appreciated as im a bit pushed for time on this one.

thanks in advance

colin
 
K

kaeli

csgraham74 said:
Hi there,

i want to create a piece of javascript that checks to see if a popup
window is open when the user clicks on the main form.

Clarify what you mean by "clicking on the main form" if you need help with
the event trapping. Clicking on the page that contains the form? On an
element IN the form? On a div that contains the form?
Generally, you're probably looking at onclick or onfocus, depending on the
element.
If the popup is
open it will set focus back to the popup and display an alert message.

im not sure of the event to use on the main form to call the function
or how to write the function.

any help greatly appreciated as im a bit pushed for time on this one.

Modify mine.

/* functions that get called when user presses a help button */
var h_window = null;
function openHelp(screenName)
{
if (!h_window || h_window == null || typeof h_window == "undefined" ||
h_window.closed || !h_window.document)
h_window = window.open("","Help","height=200,width=
200,scrollbars=yes,resizable=yes");
var doc = h_window.document;
doc.open();
doc.writeln("<html><head><title>Help</title>");
doc.writeln("<link rel='stylesheet' type='text/css'
href='myStylesheet.css'>");
doc.writeln("</head><body>");
doc.writeln(h_array[screenName]);
doc.writeln("</body></html>");
doc.close();
h_window.focus();
return;
}

--
--
~kaeli~
The more ridiculous a belief system, the higher probability
of its success.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,814
Latest member
SpicetreeDigital

Latest Threads

Top