Created
March 30, 2012 17:09
-
-
Save anonymous/2253002 to your computer and use it in GitHub Desktop.
signup.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.js" > | |
</script> | |
<script> | |
$(document).ready(function() { | |
// validate signup form on keyup and submit | |
var validator = $("#signupform").validate({ | |
rules: { | |
email_address: | |
{ | |
required: true, | |
email: true, | |
remote: { | |
url: "signup/email/check/", | |
type: "post" | |
} | |
}, | |
first_name: "required", | |
last_name: "required", | |
username: { | |
required: true | |
}, | |
password: { | |
required: true, | |
minlength: 5 | |
}, | |
confirm_password: { | |
required: true, | |
minlength: 5, | |
equalTo: "#id_password" | |
}, | |
}, | |
messages: { | |
email_address: { | |
required: "Please enter a valid email address", | |
minlength: "Please enter a valid email address", | |
remote: jQuery.format("{0} is already in use") | |
}, | |
first_name: "Enter your firstname", | |
last_name: "Enter your lastname", | |
username: { | |
required: "Please enter a valid username" | |
}, | |
password: { | |
required: "Provide a password", | |
minlength: jQuery.format("Enter at least {0} characters") | |
}, | |
confirm_password: { | |
required: "Repeat your password", | |
minlength: jQuery.format("Enter at least {0} characters"), | |
equalTo: "Enter the same password as above" | |
}, | |
} | |
}); | |
}); | |
</script> | |
<body> | |
{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %} | |
<form action="/signup/" method="POST" id="signupform">{% csrf_token %} | |
{{ form.as_p }} | |
<input type="submit" value="SignUp" /> | |
</form> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment