ripple-core
Version:
Ripple is an interactive audience response system that allows presenters to survey audience members in real time communication through their mobile devices.
30 lines (26 loc) • 739 B
JavaScript
$(document).ready(function(){
var ac = new AccessController();
var av = new AccountValidator();
$('#account-form').ajaxForm({
beforeSubmit : function(formData, jqForm, options){
if (av.validateForm() == false){
return false;
} else{
// push the disabled username field onto the form data array //
formData.push({name:'user', value:$('#user-tf').val()})
return true;
}
},
success : function(responseText, status, xhr, $form){
if (status == 'success') ac.onUpdateSuccess();
},
error : function(e){
if (e.responseText == 'email-taken'){
av.showInvalidEmail();
} else if (e.responseText == 'username-taken'){
av.showInvalidUserName();
}
}
});
$('#name-tf').focus();
});