Hello all,
I have a form with just one text field to record name of courses. I save the results to the a database table. All OK. See course-registration.png
Then I have another form where the student inserts his/her basic information and chooses the course(s) s/he wants to take.
The last field is supposed to load data from the table where the course names are stored. See student-registration.png
I found a tutorial for an older version of ChronoForms, and the name of the fields and other informations have changed. So I got lost on what to do.
Can anyone shed some light on this?
Thank you
I have a form with just one text field to record name of courses. I save the results to the a database table. All OK. See course-registration.png
Then I have another form where the student inserts his/her basic information and chooses the course(s) s/he wants to take.
The last field is supposed to load data from the table where the course names are stored. See student-registration.png
I found a tutorial for an older version of ChronoForms, and the name of the fields and other informations have changed. So I got lost on what to do.
Can anyone shed some light on this?
Thank you
Thank you GreyHead.
I'm sorry, but I am still confused. Some information on the form itself doesn't match that on the tutorial.
I believe the best choice to achieve what I want is Dynamic Data from a database table.
[list=]1. Form #1 has one field - Nome do Curso(Name of the Course) - where a course can be included into the database[/list]
[list=]2. Both Field Name and Field ID are named cursos[/list]
[list=]3. Data inserted in this form is stored in josv7_chronoforms_cadastro_cursos[/list]
[list=]4. Form #2 has three fields: Nome, Email and Cursos.[/list]
[list=]5. Cursos is the field which is supposed the retrieve data from table josv7_chronoforms_cadastro_cursos. Both Field Name and Field ID are also named cursos[/list]
[list=]6. Data submitted will be stored in table josv7_chronoforms_inscricao[/list]
[list=]7. In Cursos in Form #2 I have the following under the Dynamic Data tab:
Enabled > Yes,
Data Path > Data,
Value Key > id,
Text Key > cursos[/list]
[list=]8. I have added a DB Read action before Show HTML[/list]
[list=]9. Under the Basic tab:
Enabled > Yes,
Table Name > josv7_chronoforms_cadastro_cursos,
Enable Model ID > Yes,
Fields > cursos[/list]
So far, I haven't figured out what I'm missing.
Thank you.
I'm sorry, but I am still confused. Some information on the form itself doesn't match that on the tutorial.
I believe the best choice to achieve what I want is Dynamic Data from a database table.
[list=]1. Form #1 has one field - Nome do Curso(Name of the Course) - where a course can be included into the database[/list]
[list=]2. Both Field Name and Field ID are named cursos[/list]
[list=]3. Data inserted in this form is stored in josv7_chronoforms_cadastro_cursos[/list]
[list=]4. Form #2 has three fields: Nome, Email and Cursos.[/list]
[list=]5. Cursos is the field which is supposed the retrieve data from table josv7_chronoforms_cadastro_cursos. Both Field Name and Field ID are also named cursos[/list]
[list=]6. Data submitted will be stored in table josv7_chronoforms_inscricao[/list]
[list=]7. In Cursos in Form #2 I have the following under the Dynamic Data tab:
Enabled > Yes,
Data Path > Data,
Value Key > id,
Text Key > cursos[/list]
[list=]8. I have added a DB Read action before Show HTML[/list]
[list=]9. Under the Basic tab:
Enabled > Yes,
Table Name > josv7_chronoforms_cadastro_cursos,
Enable Model ID > Yes,
Fields > cursos[/list]
So far, I haven't figured out what I'm missing.
Thank you.
Hi helvecio,
Please drag a Debugger action into the On Submit event, then submit the form and post the debug results here.
Bob
Please drag a Debugger action into the On Submit event, then submit the form and post the debug results here.
Bob
Hello GreyHead,
Here's a screenshot of the submitted form #2.
I didn't fill any field. Just clicked submit.
Here's a screenshot of the submitted form #2.
I didn't fill any field. Just clicked submit.
Hi helvecio,
My apologies, - I should have said to put the Debugger in the On Load event (not the On Submit event). Then you can see the results from the DB Read.
And please copy and paste the output instead of using a screenshot - they are harder to read here.
Bob
My apologies, - I should have said to put the Debugger in the On Load event (not the On Submit event). Then you can see the results from the DB Read.
And please copy and paste the output instead of using a screenshot - they are harder to read here.
Bob
Thank you GreyHead.
Sorry, I thought the screenshot would be better.
I placed the Debugger action right after the HTML (Render Form) action. This is the result:
Sorry, I thought the screenshot would be better.
I placed the Debugger action right after the HTML (Render Form) action. This is the result:
Data Array
Array
(
[option] => com_chronoforms5
[view] => form
[Itemid] => 109
[cursos] => Joomla para Iniciantes
)
Array
(
)
Errors
Array
(
)
Debug Info
Array
(
[6] => Array
(
[DB Read] => Array
(
[Queries] => Array
(
[0] => SELECT `Data`.`cursos` AS `Data.cursos` FROM `josv7_chronoforms_cadastro_cursos` AS `Data` WHERE `Data`.`user_id` = '0'
)
)
)
)
Hi helvecio,
Thank you, looking at that the DB Read isn't finding any records. See the query here
Bob
Thank you, looking at that the DB Read isn't finding any records. See the query here
SELECT `Data`.`cursos` AS `Data.cursos`
FROM `josv7_chronoforms_cadastro_cursos` AS `Data`
WHERE `Data`.`user_id` = '0'
Are there any records in the table where the user_id is 0 ?
Bob
Yes. I have inserted 4 records through Form #1.
The name of the courses that I want to insert into the select field is in collumn named cursos.
I'm working on the public site, so there is no user logged in. In collumn user_id, all lines are 0.
I exported a Word file with what is in this table.
Thank you GreyHead.
The name of the courses that I want to insert into the select field is in collumn named cursos.
I'm working on the public site, so there is no user logged in. In collumn user_id, all lines are 0.
I exported a Word file with what is in this table.
Thank you GreyHead.
This topic is locked and no more replies can be posted.