Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- $(function() {
- $( "#dialog-modal" ).dialog({
- height: 259,
- width: 400,
- resizable: false,
- modal: true,
- autoOpen: false
- });
- $( "#dialog-modal" ).dialog("open");
- });
- </script>
- <div id="dialog-modal" title="Basic modal dialog">
- <form id="login">
- <input type="hidden" id="button_action" name="button_action">
- <p>Username: <input type="text" name="username" value=""></p>
- <p>Password: <input type="password" name="password" value=""></p>
- <p><input type="submit" name="existing" value="Login">
- <input type="submit" name="new" value="Register"></p>
- </form>
- <script>
- $('input[type=submit]').click(function(){
- $('#button_action').val($(this).attr('name'));
- });
- $('#login').submit(function(event) {
- event.stopImmediatePropagation();
- event.preventDefault();
- $.post('login.php', {data:$(this).serialize()}, function(data) {
- $( "#dialog-modal" ).dialog("close");
- });
- });
- </script>
- </div>
Add Comment
Please, Sign In to add comment