php – Elementor Pro Forms Validation-ThrowExceptions

Exception or error:

I have a form with 3 simple fields: name, email and company. I am trying to get all the field values into vars but can’t seem to understand how to iterate through them. I am getting my documentation from here: https://developers.elementor.com/forms-api

    add_action( 'elementor_pro/forms/validation', function ( $record, $ajax_handler ) {

      $raw_fields = $record->get( 'fields' );
      $fields = [];
      foreach ( $raw_fields as $field => $value) {
         $name = $value['name'];
         $email = $value['email'];
         $company = $value['company'];

//do something else with the vars

 }}, 10, 2 );
How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *