In article <ee**************************@posting.google.com >, csgraham74
@hotmail.com enlightened us with...
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