I am an admitted newb, and the Multi Record Loader tutorial seems straightforward enough, but I am not having success with it.
My Code:
I think I have things in the right spot in the settings side:

But when I try things out I get:
Parse error: syntax error, unexpected T_ENDFOREACH in C:\wamp\www\jobs\administrator\components\com_chronoforms\form_actions\custom_code\custom_code.php(17) : eval()'d code on line 10
My form name is CompRef. The table in the database with the actual data is jos_chronoforms_data_compref
I can save to the table successfully using a separate form. Thanks a lot in advance.
My Code:
<table>
<?php
foreach($form->data['CompRef'] as $detail);
?>
<tr>
<td>Name:<?php echo $detail['name']; ?></td>
<td><a href="index.php?option=com_chronoforms&chronoform=CompRef&token=<?php echo $detail['cf_uid']; ?>">Edit</a></td>
</tr>
<?php
endforeach;
?>
</table>
I think I have things in the right spot in the settings side:

But when I try things out I get:
Parse error: syntax error, unexpected T_ENDFOREACH in C:\wamp\www\jobs\administrator\components\com_chronoforms\form_actions\custom_code\custom_code.php(17) : eval()'d code on line 10
My form name is CompRef. The table in the database with the actual data is jos_chronoforms_data_compref
I can save to the table successfully using a separate form. Thanks a lot in advance.
Hi hilltopper06,
The error message flags a problem with the custom code. The foreach line needs to end in a colon, not a semi-colon:
Bob
The error message flags a problem with the custom code. The foreach line needs to end in a colon, not a semi-colon:
foreach ( $form->data['CompRef'] as $detail ) :
Please see if that helps.Bob
That did it! Thanks a lot. I knew it was something trivial, but I was butting my head against the wall. Thanks again.
I spoke too soon. It now displays my records, but when I click edit, it does not populate the fields with the data from the record. The URL shows the token information correctly, but none of the data passes. Any ideas?
Just to add some info. Load Fields is set to yes. I tried to set db field to cf_uid, but this causes "Empty Table!!!!!" to show up. So something isn't working there. Sorry again for what is most likely an oversight on my part when reading the tutorials.
Just to add some info. Load Fields is set to yes. I tried to set db field to cf_uid, but this causes "Empty Table!!!!!" to show up. So something isn't working there. Sorry again for what is most likely an oversight on my part when reading the tutorials.
Hi hilltopper06,
I'm not clear - do you have a DB Record load set up to populate the edit fields?
Bob
I'm not clear - do you have a DB Record load set up to populate the edit fields?
Bob
Correct. I am pretty sure that i have done it the right way, and I am attempting to "token" cf_uid as shown in the single record load tutorial. But I am doing something wrong, because when I put cf_uid in the DB Field section, I get no results. Where I do get results without it (but the edit button on those results does not populate my data into the form). Thanks.
Wait a minute, I think I just realized what you are saying. Do I need another form that handles the single record load/edit, separate from the multi record load form?
Edit:
Wow. I feel dumb, I totally misread the tutorials regarding the whole db_record load. It works now, thanks a lot!
Edit:
Wow. I feel dumb, I totally misread the tutorials regarding the whole db_record load. It works now, thanks a lot!
This topic is locked and no more replies can be posted.