<script type="text/javascript">
$(document).ready(function() {
$('#formSignup').submit(function() {
var form = $(this);
form.children('button').prop('disabled', true);
$('#success').hide();
$('#error').hide();
var faction = "<?=site_url('signup/check'); ?>";
var fdata = form.serialize();
$.post(faction, fdata, function(rdata) {
var json = jQuery.parseJSON(rdata);
if(json.isSuccessful) {
$('#success').show();
form.children('input').val('');
form.children('input').blur()
} else {
$('#errorMessage').html(json.message);
$('#error').show();
form.children('input[name="email"]').select();
}
form.children('button').prop('disabled', false);
});
return false;
});
$('.content').fadeIn(1000);
});
</script>