Docs & Support

Learn about all the Formidable features and get support from our amazing customer success team.

frm_option_is_valid

Heads up!
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.

Use the frm_option_is_valid filter to change choice-field option validation. Formidable validates submitted choice values against the options configured for the field.

Requirements

  • Formidable Forms 6.21 or later.
  • Formidable API Add-On installed and activated when you use a REST API example.

Formidable Forms makes advanced site building simple. Launch forms, directories, dashboards, and custom WordPress apps faster than ever before.

Usage

add_filter( 'frm_option_is_valid', '__return_true' );

Parameters

  • $is_valid (bool): Whether the submitted value matches a configured field option.
  • $value (array|string): The submitted field value.
  • $field (object): The field being validated.

Examples

Disable option validation

This example disables option validation for every field and every submission path.

add_filter( 'frm_option_is_valid', '__return_true' );
Important: This example allows values that are not configured as field options. Prefer a field-specific exception when possible.

Add an exception for direct REST API entry requests

This example adds an option-validation exception for direct Formidable REST API v2 and v3 entry routes.

add_filter( 'frm_option_is_valid', function( $is_valid ) {
    if ( $is_valid ) {
        return true;
    }

    $request_uri = FrmAppHelper::get_server_value( 'REQUEST_URI' );
    $entry_routes = array(
        '/wp-json/frm/v2/entries',
        '/wp-json/frm/v3/entries',
    );

    foreach ( $entry_routes as $entry_route ) {
        if ( 0 === strpos( $request_uri, $entry_route ) ) {
            return true;
        }
    }

    return $is_valid;
} );
Direct REST routes only: This example checks the request URL. It does not match Abilities API or MCP endpoints. Use the field-ID example below when the exception must work through any submission path.

Add exemptions only for specific field IDs

This example allows unconfigured option values only for the listed field IDs. Replace 1, 2, and 3 with the required field IDs.

add_filter( 'frm_option_is_valid', function( $is_valid, $value, $field ) {
    if ( ! $is_valid ) {
        $field_id_exceptions = array( 1, 2, 3 );

        if ( in_array( (int) $field->id, $field_id_exceptions, true ) ) {
            $is_valid = true;
        }
    }

    return $is_valid;
}, 10, 3 );

Limitations

  • Disabling option validation can store values that do not appear in the field's configured choices.
  • A request-URL check applies only to the routes included in the condition.
  • The field-ID example applies wherever Formidable validates the listed fields, including normal submissions and supported API entry operations.
Was this article helpful? *

This article may contain affiliate links. Once in a while, we earn commissions from those links. But we only recommend products we like, with or without commissions.

In this article

    We have a small, but amazing team of dedicated people who are committed to helping you achieve your goals and project requirements.


    Copyright © 2026 Strategy11, LLC. Formidable Forms® is a registered trademark Strategy11, LLC.

    Complete your purchase
    Don't forget your purchase!
    Complete Purchase
    Join 400,000+ using Formidable Forms to create form-focused solutions fast. Get Formidable Forms