Forums

Custom Code Input to $form->data

wayne.regehr 21 Oct, 2014
I have made a multi-page (3 page) registration form.

Brief description of form:

Page 1 - Personal Info - Includes some standard inputs + Marital Status and # of Children (drop downs).
Page 2 - Additional Info - Custom PHP code reads values of drop downs from Page 1 and outputs additional inputs based on values. This has been tested and is working correctly.
Page 3 - Group Placement Info - A few more standard inputs and submit button.

The issue I am having is that the input values from the output by my PHP code on Page 2 is not being saved to the Data Array. Essentially the user values entered are MIA.

I am guessing this issue is caused by the fact these specific inputs are not part of the form, but rather conditionally output by the PHP. I attempted adjusting the 'Render_HTML' event action from FIle to Post, as I do not require any file uploads. Next I attempted to set the inputs values to $form->data['FIELD_ID'] with another 'Custom Code' event action. This was unsuccessful. The $form->data variable is declared as expected but the value is empty.

How can retrieve the value from my PHP inputs?

I will continue to work on this and update the post should I solve the issue. If you require additional information to help troubleshoot, just let me know.
Max_admin 23 Oct, 2014
Hi Wayne,

The same custom code action should inject the new values into the data array, and this should be before the "multi page" action, because at this point a copy of the form data array is stored into the session.

Then your table should have fields names matching the new data array keys you have created using PHP, and if the fields are added recently to the table then please click the "delete cache" button in the forms manager.

But anyway, just test the first step by adding a debugger action at the last step.

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
GreyHead 23 Oct, 2014
Answer
Hi wayne.regehr,

Just adding to Max's reply, Please check that Form HTML in the browser with View Source to check that the inputs you are creating are valid HTML and are inside the ChronoForms <form> and </form> tags. If they are then the result should be submitted along with the other form inputs.

Bob
wayne.regehr 23 Oct, 2014
Thanks Gentlemen,

Max hit the nail on the head. I had verified my input markup was correct previously.

I have hardly used the multi-page to date. Ensuring that my variables were set before continuing to the next page was the key. It also makes sense.

I appreciate the assistance. You guys do a great job. Thanks.
This topic is locked and no more replies can be posted.