WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Error message

[Resolved] Error message

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Ryan

    @daobydesign

    This has to do with how CF7 handles validation errors and how I *think* error notification should be handled with a honeypot.

    In CF7, validation errors are handled on a field-by-field basis. So the message set in the HP plugin is equivalent to the “Please fill the required field.” validation notification that would appear if you try to submit a form with required fields that are empty.

    If any fields fail to validate, the “Validation errors occurred” error appears at the bottom of the form.

    There may be a way for a CF7 plugin (or “module”, as they’re called internally to CF7) to override the main form error/success message, but I’m unsure if it is possible, and also if it would be wise — as it could override other messages set by other elements of CF7.

    tl;dr

    It’s by design, but I’m open to code suggestions on how to improve it.

    Then can you explain what $result['reason'][$name] does in:

    if ( $value != '' ) {
    	$result['valid'] = false;
    	$result['reason'][$name] = wpcf7_get_message( 'spam' );
    }

    Thanks

    Plugin Author Ryan

    @daobydesign

    Pretty much nothing. If we wanted to display a validation error under the field (i.e. “Please fill the required field.”), that’s where we would set it. But as the field is hidden, and as letting robots know that they need to fix that field is probably a bad idea, it’s useless.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Error message’ is closed to new replies.