javascript to redirect the user to the dashboard after reg

This commit is contained in:
John Jarvis
2013-01-23 17:52:15 -05:00
parent 8374534802
commit 80bcf060a0

View File

@@ -225,4 +225,20 @@
<p>Looking for help in registering with edX? View our <a href="#">help section for answers to commonly asked questions</a></p>
</div>
</aside>
</section>
</section>
<script type="text/javascript">
(function() {
$(document).delegate('#register-form', 'ajax:success', function(data, json, xhr) {
if(json.success) {
location.href="${reverse('dashboard')}";
} else {
$(".field-error").removeClass('field-error');
$('#register_error').html(json.value).stop().css("display", "block");
$("[data-field='"+json.field+"']").addClass('field-error')
}
});
})(this)
</script>