Guest User

Untitled

a guest
Mar 7th, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2. $(function() {
  3.     $( "#dialog-modal" ).dialog({
  4.         height: 259,
  5.         width: 400,
  6.         resizable: false,
  7.         modal: true,
  8.         autoOpen: false
  9.     });
  10.     $( "#dialog-modal" ).dialog("open");
  11. });
  12. </script>
  13.  
  14. <div id="dialog-modal" title="Basic modal dialog">
  15.     <form id="login">
  16.     <input type="hidden" id="button_action" name="button_action">
  17.     <p>Username: <input type="text" name="username" value=""></p>
  18.     <p>Password: <input type="password" name="password" value=""></p>
  19.     <p><input type="submit" name="existing" value="Login">
  20.     <input type="submit" name="new" value="Register"></p>
  21.     </form>
  22.     <script>
  23. $('input[type=submit]').click(function(){
  24.     $('#button_action').val($(this).attr('name'));
  25.   });
  26.  
  27. $('#login').submit(function(event) {
  28.     event.stopImmediatePropagation();
  29.     event.preventDefault();
  30.     $.post('login.php', {data:$(this).serialize()}, function(data) {
  31.         $( "#dialog-modal" ).dialog("close");
  32.     });
  33. });
  34. </script>
  35. </div>
Add Comment
Please, Sign In to add comment