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
GreyHead, the link you posted went 404.
Hi helvecio,
Sorry - fixed now I hope.
Bob
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.
Hi helvecio,
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.
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
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.
Hi Helvecio,
That looks OK to me.
Please Click the Delete Cache icon in the ChronoForms toolbar - I don't think that is the problem here but it might be.
Please test the query in PHPMyAdmin and see if that gives the results you expect.
Bob