I have the following code sending my form data to upload.php via ajax. Inside the php file, the server checks the size / format of the downloaded file, etc. How can I tell ajax if this happened and stop the success message?
$.ajax({ type: 'POST', url: 'upload.php', data: dataString, success: function() { $('#getintouch .alert-error').slideUp(); $('#getintouch .alert-success').slideDown(); $('#submit').data('loading-text', 'Sent'); $('#submit').button('loading'); } });
source share