Simple post page validation
-
Hi, I need to force the posters on my wordpress site to choose a correct category – I want to make sure they can’t leave it on ‘general’ and have to select at least one category. In the post form code:
<label for=”category-1″ class=”selectit”><input value=”1″ type=”checkbox” name=”post_category[]” id=”category-1″ checked=”checked”/> General</label>
So I should be able to use javascript to just simply sayif post_category[] = category-1 then no submit.
else if post_category[] = null then no submit.
if post_category[] = at least one category (but not ‘general’) then submit.
But I can’t get the javascript to do this. I’ve attempted it 3 times now and ended up throwing out the code each time.
Anyone help out with this? I think javascript is the simplest way to do this, but if anyone has any other suggestions that would be great!
Thanks,
dave.
http://tcal.net/
The topic ‘Simple post page validation’ is closed to new replies.