I have a custom post type with a bunch of custom fields. I want to validate the meta box input with jQuery as soon as you press the Publish button. Here's what I have (I left out all my validation stuff):
$("input#publish").click(function(e){
e.preventDefault();
$("#ajax-loading").show();
$('form#post').submit();
});
As you can see I am only interrupting the form submit at this point, nothing else going on. However, posts are now saved as drafts only and I can not manually set them to published (I have administrator priviliges). As soon as I remove above code, all is back to normal.
Is there any way to get this type of client side validation working properly without using plugins? I'm on Wordpress 3.6.1.