Adding contents of a fieldset set in a mutilpier to a database

ramakunga 18 Dec, 2015
Hi

I have created a tabbed form (3) that will be used by staff to enter data and send their timesheets to payroll. The only area I am having issues with is the last tab that allows users to enter overtime in the form of text box inputs for

Date, StartTime, FinishTime, Site and Remarks.

This is created using a multi field container inside a multiplier_Contents Container which is of course siting in a multiplier container. I have done this as staff may need to have none or many entries on this tab.

The entries in this fieldset are not displaying in an email or being added to the database (all other entries are).

I believe it has something to do with the name of the fields and ID's in the fieldset. I have tried to leverage of examples in

http://www.chronoengine.com/faqs/70-cfv5/5245-how-can-i-use-the-multiplier-in-cfv5.html to no avail.

Can you advise on what I should set the field names and id’s. The following conditions are already set
Mutilpier
Replacer ##
Counter 1
Hide First Yes
Disable First Yes
Hide Buttons Yes
Start Count 1
Data Path overtime

Field set element
I have tried to name the elements overtime [##] [Date], overtime [##] [StartTime] etc and the id's to overtime_##_Date etc

Any help or guidance to understand how chronoforms handles this fiedset will be appreciated
GreyHead 18 Dec, 2015
Hi ramakunga,

Please drag a Debugger action into the On Submit event, then submit the form and post the debug - including the 'dummy emails' results here.

Note: if you are using the Easy Wizard you can turn on Debug on the Others tab in CFv4 or the Setup tab in CFv5.

Bob
ramakunga 20 Dec, 2015
Hi Bob

Hope the following makes this easier for you to help.

First picture is the form inputs as seen for the first 2 tabs

[attachment=0]chrono2.png[/attachment]

The second picture is for tab 3 which i am having trouble with, at the moment it contains a single text box

[attachment=1]chrono1.png[/attachment]

I can add multiple rows by clicking the add button but the data does not save to DB or print on emails

The picture below shows the formatted email that is sent with dummy data, note the empty box after overtime, this should contain test1, test2 and test 3 as per above screenshot

[attachment=2]chrono 3.png[/attachment]

Following are debugger screenshots (trunctaed as very long)

[attachment=3]chrono 4.png[/attachment]

[attachment=4]chrono5.png[/attachment]

The following screenshots just show the relevant section of the designer tab

[attachment=5]chrono6.png[/attachment]

[attachment=6]chrono 7.png[/attachment]

[attachment=7]Chrono8.png[/attachment]

The email to user setup includes the following to print the contents of the overtime tab to the email

<table width="auto" border="1" cellspacing="1" cellpadding="1">
<tbody>
<tr>
<td width="auto" nowrap="" valign="bottom">
<p>{repeater:text}
{Test}
{/repeater}
</p>
</td>
</tr>
</tbody>
</table>
GreyHead 21 Dec, 2015
Hi ramakunga,

It would be helpful if you included the part of the DeBugger output that shows the values returned from [extra].

Bob
ramakunga 21 Dec, 2015
Hi Bob

The parts of the debugger i am showing in the screenshots are the parts that should be showing the data returned, no data is being returned for the multiplier field. all i did was truncate the html for the table as it is long and the insert query which is just as long
GreyHead 21 Dec, 2015
Hi ramakunga,

Well, if there is a long MySQL query I guess that there must be some data somewhere. Please post the whole DeBugger output.

Bob
ramakunga 29 Dec, 2015
Sorry Bob,

My bad, I had the handle arrays component on the on-submit section not the on-load
ramakunga 29 Dec, 2015
Hi Bob

One last thing, as i am not a coder i need help in the last part of this form which is getting the id from the first database i created and inserting it into the multiplier data array in the second database. I have attached a debugger showing that the data is being saved in both databases as expected, I just need to ensure the ID's are the same for each submission of the form as per your FAQ.

The debugger output is quite long so i have attached it as a PDF

Thanks so much for you assistance so far

cheers
GreyHead 30 Dec, 2015
Hi Ramakunga,

The new record id is shown here
[Approved] => Approved
[SubmitButton] => Submit Timesheet
[ip_address] => 192.168.49.225
[id] => 1
so you need to add that to each of the entries in the 'extra' array using a Custom Code action with code like this:
<?php
foreach  ($form->data['extra'] as $k => $v ) {
  $form->data['extra'][$k]['xxx'] = $form->data['id'];
}
?>
but replace xxx with the column name where you want the id saved.
Bob
ramakunga 31 Dec, 2015
Thanks Bob

That worked a treat 🙂

One last thing, can you send me a copy of the unique [GH] ID Action so i can add this to my form

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