On Sep 11, 7:04 am, Scott González <[EMAIL PROTECTED]> wrote:
> You say that you destroy the dialog on close, but you never create a
> new one, so there's no dialog to open.  If you need more help, you'll
> need to show your test page.

The dialog is created (with autoOpen: false) every time #content is
loaded:

-------- (dialog.html) --------

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml";>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
    <title>dialog.html</title>
    <link rel="stylesheet" href="script/jquery.ui-trunk/themes/flora/
flora.all.css" type="text/css" media="screen" title="Flora
(Default)"></link>
    <script type="text/javascript" src="script/jquery.ui-trunk/
jquery-1.2.6.js"></script>
    <script type="text/javascript" src="script/jquery.ui-trunk/ui/
jquery.ui.all.js"></script>

    <script type="text/javascript">
      $(document).ready( function() {
        $("#content").load( "content.html" );
      });
    </script>

  </head>
  <body>
    <div id="content"></div>
  </body>
</html>

-------- (content.html) --------

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script type="text/javascript">

  function onCloseDialog()
  {
    if ( $("#formSubmitted").attr( "value" ) != "false" )
    {
      $("#dialog").dialog( "destroy" );
      $("#dialog").load( "form_init.html" );
    }
  }

  $(document).ready( function() {
    $("#dialog").dialog( { autoOpen: false, close: onCloseDialog } );
    $("#openDialogLink").click( function( event ) {
      event.preventDefault();
      $("#dialog").load( "form_init.html" ).dialog( "open" );
    });
  });

</script>

<a href="#" id="openDialogLink">Open Dialog</a>
<div id="dialog" class="flora" title="Dialog"></div>
<input id="formSubmitted" type="hidden" value="false" />

-------- (form_init.html) --------

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script type="text/javascript">
  $(document).ready( function() {
    $("#form").submit( function( event ) {
      event.preventDefault();
      $("#dialog").load( $(this).attr( "action" ) );
    });
  });
</script>

<form id="form" action="form_submitted.html">
  <input type="submit" name="submit" value="Submit" />
</form>

-------- (form_submitted.html) --------

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script type="text/javascript">
  $(document).ready( function() {
    $("#form").submit( function( event ) {
      event.preventDefault();
      $("#dialog").load( $(this).attr( "action" ) );
    });
  });
</script>

<form id="form" action="form_submitted.html">
  <input type="submit" name="submit" value="Submit" />
</form>

----------------


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to