Advertisement
Guest User

Untitled

a guest
Feb 29th, 2012
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script type="text/javascript">
  2.      $(document).ready(function(){
  3.  
  4.  
  5.         // setup the modal dialog
  6.         $("#dialog").dialog({
  7.             autoOpen: false,
  8.             modal: true,
  9.             resizable: false
  10.         });
  11.        
  12.         $("#dialog").dialog({
  13.             buttons: {
  14.                 "Yes": function() {
  15.                     userConfirmed = true;
  16.                     $("#inputform").submit();
  17.                 },
  18.                 "No, I'll change them.": function() {
  19.                     $(this).dialog("close");
  20.                     $('#totalDays').focus();
  21.                 }
  22.             }
  23.         });
  24.        
  25.         var userConfirmed = false;
  26.        
  27.         // check they've submitted what they need to
  28.         $("form").submit(function(e) {
  29.  
  30.             $("#dialog").dialog("open");
  31.  
  32.             return userConfirmed;
  33.  
  34.         });
  35.        
  36.     });
  37. </script>
  38.  
  39. <form method="POST" action="<?php echo CURRENT_PAGE ?>" name="inputform" id="inputform">
  40.         <div class="buttons">
  41.             <button type="submit" name="submit" id="submit">Submit form</button>
  42.         </div>
  43.     </div>
  44.  
  45. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement