• 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 say

    if 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/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Simple post page validation’ is closed to new replies.