View Full Version : DHTML Window Widget (v1.1) Help Required

05-28-2008, 02:57 AM
Script Title: DHTML Window Widget (v1.1)

Script URL (on DD): http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/

Hi, I am trying to do open a url in the iframe using the modal window. But am I able to call a javascript function that is currently loaded in the modal window?

I am currently stuck at this for a very long time. Please help. Thanks!!!

var emailwindow=dhtmlmodal.open('EmailBox', 'iframe', 'modalfiles/newsletter.htm', 'Newsletter Signup page', 'width=350px,height=200px,center=1,resize=0,scrolling=1')
emailwindow.onclose= ....

05-28-2008, 03:03 AM
I didn't quite get that. Can I see the rest of your script? And your trying to get it to open up another page?

05-28-2008, 03:09 AM
Sorry, let me rephase:

I have a page that calls upon the above script to view a page (example.html) in the dhtml modal window. However, when the user clicks the close button, I would like the onclose method to call upon a method in the example.html.

Is that possible?

05-28-2008, 03:23 AM
Also, somehow the modal window's onclose function does not work either. It closes the window without any questions asked.

05-28-2008, 03:24 AM
I think that you have to enable that. Can't help with your first question though.

05-28-2008, 04:30 AM
Hi Nile, so how do I do that? The examples given did not work either. Thanks!

05-28-2008, 11:39 AM
Here, an example from the page:

//your code here

A custom event handler that executes your desired code whenever the window is being closed. By returning false, you can cancel that action of closing the window. Here's an example that asks the user for confirmation when he/she attempts to close a window:

//returns false if user clicks on "No" button:
var returnval=confirm("You are about to close this window. Are you sure?")
return returnval