Reload Action - Set Data

Set data from a database read to a text field after a reload event in ChronoForms.

Overview

The issue was an incorrect syntax when trying to assign data from a database read action to a form field.
Use a PHP element after the read data action to correctly retrieve the database value and set it to the desired form field data key.

Answered
tr trykar 13 Sep, 2017
Hi, first of all i want to say Chronoform6 ist sooo amazing ... i love itπŸ˜‰
I have a Problem.
I use CF6 and i do a reload event "reload_untersuchungsdauer1" on an field_text when i use a dropdown - everything works fine.
The reload event do an read_data (read_data25 Model: db) on a database ... when i debug i see the right data in the array. I do also a {view:...} on the textfield elemet ... and it comes back again.
What i dont't check is how i get the read_data back to the textfield elemet.

I know when i do on an custom code@ the setup under the event with:
{data.set:untersuchung_dauer$xxx} xxx comes back to the textfield elemet ... but i want to get the new read_data (read_data25 Model: db) back to the textfield element like {data.set:read_data2.db.untersuchung_dauer} or
{data.set:untersuchung_dauer${data:read_daata25.db.untersuchung_dauer}}
Or when i put {var:read_data25.db.untersuchung_dauer} in the text_fiel Value after the reload event i get no DB data from the read_data.

I think i have a failure on the syntax. I hope you can understand. Can you help me out?
tr trykar 13 Sep, 2017
Answer
2 Likes
I found out ... with a php element in the setup afte the read_data:

$dauer=$this->get("read_data25.db.untersuchung_dauer");
$this->data("untersuchung_dauer",$dauer,true);
This topic is locked and no more replies can be posted.