Custom action when dialog close

Custom action when dialog close


Hi,

I have this dialog:

  1. <div id="dialogAlert" data-role="popup" data-overlay-theme="b" data-theme="b" data-dismissible="false" style="max-width: 400px;">
  2. <div id="divTitle" data-role="header"><h1 id="headerTitle"><label id="msgHeader" style="font-size: large; font-weight: bold;" /></h1></div>
  3.     <div role="main" class="ui-content">
  4.     <p id="msgAlert"></p>
  5.     <a href="#" class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-btn-b" data-rel="back">Close</a>
  6.     </div>
  7. </div>

when error I am using:

  1. $('#divTitle').css("background-color", "#FF0000");
  2. $('#msgHeader').text("Error!");
  3. $('#msgAlert').html("Please enter the new password!<br><br>Password must be at least 5 digits.");
  4. $('#dialogAlert').popup();
  5. $("#dialogAlert").popup("open");

and when success I am using:

  1. $('#divTitle').css("background-color", "");
  2. $('#msgHeader').text("Thank you");
  3. $('#msgAlert').html("You must confirm the new password<br><br>Please check your email to confirm.");
  4. $('#dialogAlert').popup();
  5. $("#dialogAlert").popup("open");

I want to know how to redirect to home.php when success after closing the dialog if I am using same dialog for fail and success?


Thanks,