Forums

Modify, then save to db

claus@woges.dk 22 Oct, 2011
Hi, i am trying to do a form with some post calculation of a total price which is also a hiddenfield on the form and defined as a column in the db. The total price is calculated depending on some of the form input. I do the calculation in a custom code action by using JRequest::Setvar. When i investigate the data set by this statement (php.echo...) it is as expected, but a debug action (showing the post array) and the value stored in the db shows the default value assigned in the form design, instead of the calculated value. The DB save action is placed after the calculation in the action list. What am i doing wrong ?🤨
GreyHead 22 Oct, 2011
Hi [email]claus@woges.dk[/email],

In ChronoForms v4 saving back to the post array doesn't work. Instead save to the $form->data array, then the values should be saved OK.

Bob
claus@woges.dk 23 Oct, 2011
Thanks Bob,
Just what i needed, the beer is on me ;-)
This topic is locked and no more replies can be posted.