Support Log in

20. Custom Validation Rules

Developer Guide
Prefer video? Watch the Fillin Forge tutorials 9 short guides covering every feature Watch

There is no hook that runs your own validation before a submission is saved.

The built-in checks are described in Validation. To run your own rules, listen to formforge/submission_created. It fires after the submission is saved, so it can flag or report an entry but it cannot reject it.

php
add_action( 'formforge/submission_created', function ( $submission_id, $payload ) {
    // $payload['fields'] holds the submitted values by field key
    if ( empty( $payload['fields'] ) ) {
        return;
    }
    // check them against your own rules and report the result
}, 10, 2 );
Forge AI Assistant Online

Hi! I'm the Fillin Forge AI assistant. Ask me anything about the plugin — setup, features, troubleshooting, or development.

Just now
Powered by Forge AI · Browse docs