• Resolved jpagano

    (@jpagano)


    I’ve a select form field prefilled with the filter wpcf7_form_tag_data_option and the validation message appears and the field is marked invalid.

    Because I’ve a second select field that needs the value of the first select to make an AJAX request, I need to disable this because I do all the validation in the wpcf7_validate_select* filter.

    I’ve tried to disable the new action introduced in 6.1.0 version, but I can’t. I’ve checked the action name and is registered with this name.

    The snippets that I’ve tried

    remove_action('wpcf7_init', 'reset_select_enum_rules', 100);

    remove_action('wpcf7_init', 'Cf7_2_Post_Public–>reset_select_enum_rules', 100);

    There’s a way to disable the Schema-Woven Validation in your plugin?

    Thanks!

    • This topic was modified 5 months ago by jpagano.
    • This topic was modified 5 months ago by jpagano.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Aurovrata Venet

    (@aurovrata)

    I’ve a select form field prefilled with the filter wpcf7_form_tag_data_option and the validation message appears and the field is marked invalid.

    the CF7 plugin now pre-loads valid values for each dropdown field (a rather silly and useless functionality) and checks the selected value on the form using js.

    I’ve tried to disable the new action introduced in 6.1.0 version, but I can’t. I’ve checked the action name and is registered with this name.

    can you confirm your select field works when you disable the Post My CF7 Form plugin?

    Thread Starter jpagano

    (@jpagano)

    can you confirm your select field works when you disable the Post My CF7 Form plugin?

    No, the field don’t work because the validation is triggered by CF7 and not your plugin.

    remove_action('wpcf7_init', 'reset_select_enum_rules', 100);

    My actual “fix” is to downgrade to 6.0.7 version and re add the previous snippet to disable the validation.

    Thanks!

    Plugin Author Aurovrata Venet

    (@aurovrata)

    So this is a CF7 plugin issue?

    Did you post it on the CF7 support forum?

    Plugin Author Aurovrata Venet

    (@aurovrata)

    I had a quick look at the code executing the filter . It turns out that the default use is for the listo plugin (to supply preset lists).

    So in order to get it to work you need to do the following,
    First ensure your custom select field has a data option set, something like,

    [select customdd include_blank data:customdata]
    

    then hook your data function after that of the listo functionality…

    add_filter( 'wpcf7_form_tag_data_option', 'set_customdd', 11,3 ); //set to 11 or more
    function set_customdd( $values, $options, $args ) {
      if( isset($options[0]) && 'customdata' === $options[0] ){
        $values = array( 'Custom 1', 'Custom 2', 'Custom 3' );
      }
      return $values;
    }

    this will ensure that the dropdown is properly setup and the swv schema properly populated with the accepted values.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.