Forum Moderators: open
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.
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.
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()" ...
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.