//Example: Sends an id as data to the server, save some data to the server and notify the user once it's complete. //Note that this usage - returning the result of the call into a variable - requires a synchronous (blocking) request! (async:false) checkform = function(formData, jqForm, opt){ var chkemail = jqForm[0].wit_email.value; valid_check = $.ajax({url: '_tools/playbook.lasso', global: false, type: 'POST', data: ({what: chkemail, route: 'validate', task: 'email'}), dataType: 'html', async: false}).responseText; if(valid_check == 'true') return true; else{ $('input[name=wit_email]').addClass('redtext'); $('label[for=wit_email], label[for=wit_editemail]').addClass('redtext'); return false; } }