wordpress add post validation


Staff member
This is embarrassing, but yet i am surprised to see that there is no validation by default while adding a new post in wordpress. When i don't enter a title and even content, and just hit Publish, it says that the post is published, and when i view the front end, there is no new post.

How could wordpress skip the simple validation for adding a post? Atleast i expected a server side validation (if not client side). Don't know why the validation is skipped. It is upto wordpress, whether they incorporate it in the new versions.

But i want to know how can i add a javascript (or jquery) validation for adding a post in wordpress.
I know it must not at all be difficult. But being new to wordpress, i would like to get some hint.

From Firebug, i could see the form is rendering like:

<form id="post" method="post" action="post.php" name="post">

Where shall i put my javascript validation code?