I am learning ChronoForms V4 and I do have a lot of fun with it and really love it.... but..
I managed to have one form save into two tables, but that is when one field is going into one table.
I cannot find a way to save one field into two different tables...
Is there a way of doing this?
Thanks,
Hi pieter,
What is saved depends on the input and column names; if they match then the data is saved. If both columns have the same name this should work, if the secodn column has a different name then you need to use a Custom Code snippet to copy the value into a new entry in the $form->data array to match the second column name.
Bob
Hi pieter ,
Yes, exactly like that. Drag a Custom Code action into the event and move it up before the DB Save actions.
Bob
Thanks,
I only don't get it to work... is my syntax ok?
Is $form->data['bladibla'] working in this way or can it onlt work when there already is something in the table?
Or is my better option to rename the column?
Hi pieter,
It will work provided that there is data in the $form->data array, adding a Debugger action temporarily will tell you what is there.
If it's simple to do and doesn't affect other places the table is used then renaming the column is fine.
Bob
Thanks,
there is no data as it has to be submitted first.. (I think) ... renaming the column did the trick for me...
Thank you for your help on this.