WordPress.org

Ready to get started?Download WordPress

Forums

Empty comment fields (3 posts)

  1. changethethought
    Member
    Posted 6 years ago #

    I know there has been a lot of topics covering the issue of custom error pages when dealing with wp_die() but I just keep thinking there has got to be an easier fix for dealing with empty comment fields.

    Is there any way, if your theme has a comments.php file to add an if else if, so that if the user had not typed anything in the comments field, name field, email field, etc. that you could just display, within the missing fields something like, "Please enter a comment"?

    That way wp_die() won't even be called, the user will just see the "Please enter a comment" in the field they haven't filled out yet.

    Is this a tough thing I am asking here? I have very little background in PHP but used to write a lot of actionscript and this is how we dealt with empty fields in Flash. It just seems counter intuitive to immediately direct someone to an entirely different error page for type missing in a comment field.

  2. changethethought
    Member
    Posted 6 years ago #

    Anyone have any ideas?

  3. changethethought
    Member
    Posted 6 years ago #

    Ha ha! I found a few javascript plugins that took care of this and added axax checking to my comment forms. No more crappy error page. Thank you lord.

Topic Closed

This topic has been closed to new replies.

About this Topic