Can not use $this->data{'fieldI name') in PHP action block

Access form field data in a ChronoForms PHP action block.

Overview

The issue occurs when using incorrect syntax to reference form field values within the PHP action code.
Ensure the PHP action is placed in the correct form processing tab, such as the Submit tab, and use the proper syntax to retrieve the field data.

Answered
ChronoForms v8
ki kittisak 19 Jun, 2024

I try to use simple PHP code in PHP action block to retrive data from text field with this code

if ($this->data('text_12') == "Yes!"){      return "Reload";        } else {          return $this->data('text_12');}on debug this PHP block have no any value.What's wrong?

rb rbock 19 Jun, 2024
Answer

Where did you insert the PHP action? In the submit tab? I just tested it and it works. Text in the load tab, PHP action in the submit tab.

This topic is locked and no more replies can be posted.