Forum Moderators: open

Message Too Old, No Replies

Creating an interstitial popup to load a form

         

madk

5:57 pm on Nov 21, 2006 (gmt 0)

10+ Year Member



Hello guys,

I'll be the first to admit that I am pretty much a rookie when it comes to JavaScript. So that is why I have come here for help.

I am looking to create an interstitial popup similar to the example found here: [dynamicdrive.com...]

The major difference is that I'd like to trigger it by clicking a link. I'd also like to be able to sent the loaded page a value because I am going to be loading a form that is associated with the link that was clicked. The last requirement would be that the homedocument reloads when the popup is closed.

Any help will be greatly appreciated! Thanks in advance.

Matt.

Fotiman

6:56 pm on Nov 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Description: An interstitial is a container that appears over an entire webpage intermittingly to display content in an eye catching way.

You might try using the Yahoo UI Library [developer.yahoo.com]'s Container [developer.yahoo.com] family of components, including the Dialog [developer.yahoo.com] or SimpleDialog [developer.yahoo.com] components.

phranque

12:14 am on Nov 22, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



to pop up a window you could code your anchor like:
<a href="http://some.url" target="_blank" onClick="window.open('http://some.url', 'some_name', 'scrollbars=yes,resizable=yes,width=X,height=Y'); return false"> pop up a feature </a>

loading the form value could get complicated by frames and layers in the page structure, but assuming the simplest case you could do something like this in some javascript:
opener.document.forms[0][parameter_name].value = parameter_value;

to reload the home document you could do some thing like:
<script language="JavaScript" type="text/JavaScript">
<!--
function refreshParent(){
opener.document.location = opener.document.location
} //-->
</script>

and then perhaps somewhere in the submit-type input tag:
... onClick="javascript:refreshParent();self.close()" ...

madk

5:39 pm on Nov 25, 2006 (gmt 0)

10+ Year Member



Fotiman:

Thank you for the link. After doing some research I managed to use the Yahoo UI library. I was incredibly impressed with their software as if is extremely useful! Thanks again.

phranque:

I was not looking to create a normal popup window. Please see Fotiman's post for a definition of the type of window I was looking to create. Thanks.