horizontal_logo-black
Viewing 1 reply thread
  • Author
    Posts
    • #5319
      DI (FH) Wolfgang Jelinek
      Guest

      Hello,

      first, thank your for the great Plugin.

      I want to switch from an existing form to a Multistep-Form. Maybe you can help me with field validation. I cannot find something in the documentation.

      With the “normal” ACF-Plugin, I had a function checking if the phone number has at least 11 characters.
      How can I do the same with your Plugin when clicking on the next step button?

      *add_filter(‘acf/validate_value/key=field_5ff08e81392c5’, ‘my_acf_validate_value’, 10, 4);**
      ****
      **function my_acf_validate_value( $valid, $value, $field, $input ){**
      ** if( !$valid ) {**
      ** return $valid; **
      ** }**
      **
      ** $my_text_field = $_POST[‘acf’][‘field_5ff08e81392c5’];**
      ****
      ** if ( strlen($my_text_field) < 11 ) { **
      ** $valid = ‘Tel.Nr. is too short!’;**
      ** } **
      ** return $valid; **
      **}*

    • #5320
      Shabti Kaplan
      Keymaster

      Thank you for your question!

      Under the multi-step tab, turn on “Validate each step”. This way the form will run validation on each individual step as you go.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.