<style type="text/css">
.notice { display: none; }
</style>

<form method="POST" id="signup-form">
<p>{"Your name"}:<br /><input type="text" name="name" size="40" value="{{ name }}" />
<span class="notice" id="name-notice">{"You must enter your name."}</span></p>
<p>{"Email address"}:<br /><input type="text" name="email" size="40" value="{{ email }}" />
<span class="notice" id="email-notice">{"You must enter a valid email, or your email may already be registered."}</span></p>
<p>{"Choose a password"}:<br /><input type="password" name="password" size="20" value="{{ password }}" />
<span class="notice" id="password-notice">{"Your password must be at least 6 characters."}</span></p>
<p>{"Verify password"}:<br /><input type="password" name="verify_pass" size="20" value="{{ verify_pass }}" />
<span class="notice" id="verify_pass-notice">{"Your password doesn't match."}</span></p>
<p><input type="submit" value="{"Sign Up"}" /></p>
</form>

<p>{"Already a member?"} <a href="/user/login">{"Log in here"}</a><br />
<a href="/user/recover">{"Forgot your password?"}</a></p>


<script type="text/javascript" src="/js/jquery.verify_values.js"></script>
<script type="text/javascript">
$(function () {
	$('#signup-form').verify_values ({
		handler: 'user/signup',
		callback: function (failed) {
			// highlight the failed elements
			for (var i = 0; i < failed.length; i++) {
				$('#' + failed[i] + '-notice').show ();
			}
		},
		reset: function (fields) {
			for (var i = 0; i < fields.length; i++) {
				$('#' + fields[i] + '-notice').hide ();
			}
		}
	});
	{% foreach failed %}
	$('#{{ loop_value }}-notice').show ();
	{% end %}
});
</script>
