Dialog buttons don't support return values (there's nowhere to return the value to). What you want to do is add window.location = 'test.php' as the last line of the Ok button function (it can actually be the only line since redirecting will destroy everything on the page). You'll then want to uncomment the return false in your click handler.
On Jul 29, 7:46 am, dora <[email protected]> wrote: > Hi > > I have some doubts in jquery UI dialog, i wrote the code like > below > > 1. In the form i have a link <a href="test.php" id="user">Link</a> > 2. when i click the link, dialogbox will be opening. > 3. there are two buttons in the dialog box OK,CANCEL > > my doubt is when i click OK, dialog box will be close and page > redirects to test.php > if i click CANCEL, only dialog box will be close. pls clarify me > > $(function() { > $("#dialog").dialog({ > bgiframe: true, > resizable: false, > height:140, > autoOpen: false, > modal: true, > overlay: { > backgroundColor: '#000', > opacity: 0.5 > }, > buttons: { > Ok: function() { > $(this).dialog('close').remove(); > alert(event.type); > //return false; > }, > Cancel: function() { > $(this).dialog('close'); > return true; > } > } > > }); > > $('#user').click(function() { > $('#dialog').dialog('open'); > //return false; > }); > > }); --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
