Hello! When manually changing a multi-page form CF5 to CF6, I have the problem that I can not automatically fill the address fields of the form with the data that I read from the address database. Basically, the user enters his member identification on the first page of the form. The access to the address database and the address data (including the first name, last name, address, etc.) are triggered by this member identification. The second page of the form is filled with the found data. The names / IDs are identical on the address database and in the form.
In CF5 I used the action [DB Read]
- Table name: t_afo_mitgliederverwaltung
- Conditions: <? Php returnArray ('#mitglied' => $ form -> data ("suchbegriff1")); ?>
==> result: the form fields are filled automatically!
In CF6, I use the [Read Data]
- Model name: member
- Tabel name: t_afo_member administration
- Where conditions: <? Php return [["#mitglied", $ this-> data ("suchbegriff1")]]; ?>
- Select type: First matching record.
- Paging for multipe results: Enable
==> According to the debugger the data recorder is found and read out
==> the form fields are not filled.
Please, can you help me?
Hi Peter,
In v6 there is one extra step, the "Data provider" in the "display section" must take the data set of the "read data", e.g:
{var:read_data_action_name}
You could also set the conditions like this:
#mitglied:{data:suchbegriff1}
but its strange to have "#" at the table fields ?
Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hi Max
Many thanks for the answer.
The command {var: read_data_action_name} must, in my opinion, be supplemented by the module name:
{Var: read_dat_action_name.ModuleName}
example: {var: read_data6.Model}
-> read_data_action = name corresponds to the black folder: exampel [name: read_data6]
-> Module_name = name corresponds to the selected module name (if the module name is left blank, the system will automatically assigns the name 'Modules'.
Thanks also for the note regarding the where condition. A and / or condition is also possible
Example:
name: {data: keyword1}
first name: {data: keyword2}
or
mitgliednr: {data: keyword1}
In this context, I still have a connection question. Is it also possible to make a query using LIKE
for example: where name like '% xyz%'
What is the syntax?
Thank you in advance for your support.
Peter
Hi Peter,
Yes, its actually like you wrote:
{var:read_data6.Model} //no space after the :
The like can be done this way:
name/like:%{data:keyword1}%
Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hello Max
Thank you for your support. Accessing with «like» works perfectly. CF6 convinces me and I hope that in the near future a detailed description with examples regarding the new functions will be available. CF6 deserved this!
You're doing a good job - thank you!
Peter
Hi there,
Could you please say why the where condition syntax is different now?
<? Php return [["#mitglied", $ this-> data ("suchbegriff1")]]; ?> (CF6) works but
<? Php returnArray ('#mitglied' => $ form -> data ("suchbegriff1")); ?> (the CF5 syntax) doesn't work in CF6?
It seems like the CF5 condition is still valid for php code but is not correct for CF6.
Cheers
Tim
Hi Tim,
This has been improved, please use the new syntax, in most cases php is not needed:
field_name:{data:url_parameter}
Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Thanks a lot for the hint! Works fine (I removed the hidden field ;-) )
I'm trying to make a multipage form where into the first step, I started with the demo "Auto Completer". into debug I see get only one value - id, but I'd like to obtain some other value of the table:
id
name
surname
code
country
and display them into read-only field
Thanks
What does your "fields to retrieve" look like in your database read?