xanvis
06-06-2008, 04:49 AM
1) Script Title: DHTML MODAL
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/dhtmlmodal.htm
3) Describe problem:
I wrote the modal open function to accept content as a variable - so that I can have different content in the same iframe. The problem is the parent.thismodalwindow.close() does not work when I pass the content name as variable. This is what I meant ...
<script type="text/javascript">
function openurlmodal(targetUrl, boxTitle){ //Define arbitrary function to run desired DHTML Window widget codes
var ajwin=dhtmlmodal.open("ajaxurlbox", "iframe", targetUrl, boxTitle, "width=650px,height=450px,center=1,resize=1,scrolling=1", "recal")
ajwin.onclose=function(){return true}
}
<a href='#' onClick='openurlmodal("modalfiles/externalFormClose.htm", "Html!!"); return false'>Test Value Passing 2 !!</a>
<br>
And this is the code in the referenced content
<input type="button" value="CLOSE" name="X2" onClick="parent.ajwin.hide()" />
But this does not work.
However in my open statement if I directly pass the content name in the open statement - the close button works
function openurlmodal(targetUrl, boxTitle){ //Define arbitrary function to run desired DHTML Window widget codes
var ajwin=dhtmlmodal.open("ajaxurlbox", "iframe", "modalfiles/externalForm.htm", boxTitle, "width=650px,height=450px,center=1,resize=1,scrolling=1", "recal")
ajwin.onclose=function(){return true}
}
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/dhtmlmodal.htm
3) Describe problem:
I wrote the modal open function to accept content as a variable - so that I can have different content in the same iframe. The problem is the parent.thismodalwindow.close() does not work when I pass the content name as variable. This is what I meant ...
<script type="text/javascript">
function openurlmodal(targetUrl, boxTitle){ //Define arbitrary function to run desired DHTML Window widget codes
var ajwin=dhtmlmodal.open("ajaxurlbox", "iframe", targetUrl, boxTitle, "width=650px,height=450px,center=1,resize=1,scrolling=1", "recal")
ajwin.onclose=function(){return true}
}
<a href='#' onClick='openurlmodal("modalfiles/externalFormClose.htm", "Html!!"); return false'>Test Value Passing 2 !!</a>
<br>
And this is the code in the referenced content
<input type="button" value="CLOSE" name="X2" onClick="parent.ajwin.hide()" />
But this does not work.
However in my open statement if I directly pass the content name in the open statement - the close button works
function openurlmodal(targetUrl, boxTitle){ //Define arbitrary function to run desired DHTML Window widget codes
var ajwin=dhtmlmodal.open("ajaxurlbox", "iframe", "modalfiles/externalForm.htm", boxTitle, "width=650px,height=450px,center=1,resize=1,scrolling=1", "recal")
ajwin.onclose=function(){return true}
}