ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Comment form: custom error handling

February 19, 2011 12:28pm

Subscribe [3]
  • #1 / Feb 19, 2011 12:28pm

    lukemartin

    2 posts

    Hello

    I’m trying to implement custom error handling on my comments form - if a user doesn’t enter a required field, they get taken to the default EE “The form you submitted contained the following errors” page.

    How can I overwrite this to display a message above the form instead of having an intermittent page?

    I’m running EE v2.1.3.

    Thanks a lot
    Luke

  • #2 / Feb 21, 2011 1:46am

    John Henry Donovan

    12339 posts

    Luke,


    You could use a JavaScript solution here to validate those fields. So it won’t let you proceed to a new page before your rules are met. jQuery is a popular solution and it’s Validate plugin

    Take a look here where I explain how to implement it for a different EE form

  • #3 / Feb 21, 2011 8:38pm

    lukemartin

    2 posts

    Hi John

    Yep I’d planned on adding some JS validation already, but wanted to give my non-JS users a nicer experience than default EE error templates. After further research I’ve realised this isn’t really possible currently. That’s a shame 😊

    Thanks anyway
    Luke

  • #4 / Feb 22, 2011 10:42am

    Sue Crocker

    26054 posts

    Hi, Luke. Sorry there isn’t a better solution - it depends on the number of non-JS users you have, and how many of those actually comment. Don’t hesitate to post again as needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases