Andries' suggestion should work. You can close dialogs by
calling .dialog('close') on the element the dialog was created from.
You could also use the buttons option to create the buttons yourself,
rather than having them be part of the content loaded into the div.
$('<div id="myDiv"/>').load("WebForm1.aspx").dialog({
buttons: {
Ok: function() { ... },
Cancel: function() { $(this).dialog('close'); }
}
});
The context of the button functions are the dialog element, which is
why you can call .dialog('close') on it.
On Dec 28, 6:18 am, "Andries Snyman" <[email protected]> wrote:
> Hi,
>
> Won't it help to have an onClick event with just a
> <$("#dialog").dialog("close");>?
> Because even if the WebForm1.aspx is a page on its own, it's still loaded
> into the current page and the same js components still exist.
> Kind regars
>
> On Sat, Dec 27, 2008 at 8:56 AM, jQDeveloper <[email protected]> wrote:
>
> > Hi All,
>
> > I was trying to replace my window.open() code with the jQuery Dialog
> > box. Now here is my code:
>
> > $(function() {
> > $("<div id='mydiv'></div>").load("WebForm1.aspx").dialog();
> > });
>
> > WebForm1.aspx has Ok and Cancel buttons. I want to close my Dialog box
> > when I click on Cancel from WebFrom1.aspx. Can anyone tell me how to
> > do it.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---