Skip to content

Instantly share code, notes, and snippets.

@tubbo
Created August 6, 2010 18:50
Show Gist options
  • Select an option

  • Save tubbo/511777 to your computer and use it in GitHub Desktop.

Select an option

Save tubbo/511777 to your computer and use it in GitHub Desktop.
<form id="login-window" action="/session" method="post" title="Sign in with your username and password">
Login: <input id="login" name="login" type="text" /><br />
Password: <input id="password" name="password" type="password" />
</form>
<script type="text/javascript">
$(document).ready(function() {
$('#login-window').dialog({
autoOpen: false,
resizable: true,
draggable: false,
modal: true,
buttons: {
"Log In": function() {
$.post('/sessions', $('#login-form').serialize(), function() {
$(this).dialog('close');
location.reload(); // refresh page
});
},
"Cancel": function() {
$(this).dialog('close');
},
"Register": function() {
window.location = '/signup';
$(this).dialog('close');
}
},
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment