wordpress add post validation
Posted
by
dskanth
on Stack Overflow
See other posts from Stack Overflow
or by dskanth
Published on 2013-06-27T04:18:25Z
Indexed on
2013/06/27
4:21 UTC
Read the original article
Hit count: 182
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">
...
</form>
Where shall i put my javascript validation code?
© Stack Overflow or respective owner