$(document).ready(function() { $('#ajaxSubmit').click(function() { $(document.body).css({'cursor' : 'wait'}); SubmitForm(); setTimeout(function() { $(document.body).css({'cursor' : 'default'}); }, 2000); }); }); function SubmitForm() { var vals = $('.ajaxForm .form').find('select, textarea, input').serialize(); $.ajax({ type: 'POST', url: 'https://www.rivermead.org//Components/Form/Assets/AJAX/SubmitForm.php', dataType : 'text', // data type data : vals, success: function(msg){ var ret = msg.split(':'); if (ret[0] == 1) { $('.ajaxSuccess').show(); $('.ajaxBefore').hide(); } else { $('#ajaxMessage').html('