Hello everybody,
in my current project it is at the discretion of a registrant to enter a number of participants to an event from 1-15. I've made the according setting to be able for them to draw up a line of fields featuring 'Name' and 'Gender'. An 'Add one' button repeats these fields until the chosen number of participants are represented in the number of field rows.
Here's my question: how can I make it work that the data entered can be saved in the DB and shown in an e-mail? The end of this very nice and useful support page is a bit vague on this / does not compute with my limited knowledge:
http://www.chronoengine.com/faqs/58-cfv4/cfv4-elements-and-html/2700-how-can-i-have-a-button-to-add-more-form-inputs.html
I'd appreciate any help!
Thanks very much
Chris
in my current project it is at the discretion of a registrant to enter a number of participants to an event from 1-15. I've made the according setting to be able for them to draw up a line of fields featuring 'Name' and 'Gender'. An 'Add one' button repeats these fields until the chosen number of participants are represented in the number of field rows.
Here's my question: how can I make it work that the data entered can be saved in the DB and shown in an e-mail? The end of this very nice and useful support page is a bit vague on this / does not compute with my limited knowledge:
http://www.chronoengine.com/faqs/58-cfv4/cfv4-elements-and-html/2700-how-can-i-have-a-button-to-add-more-form-inputs.html
I'd appreciate any help!
Thanks very much
Chris
Hello sloanthrasher,
I don't know exactly how I can store the information, which is part of my question, I guess. When I try to add a new table, it doesn't let me because of the invalid field names that are probably provided through the custom codes:
addone_{$j}
recipient[{$i}][name]
recipient[{$i}][address]
This is highlighted in red when I try to add a table to the form. If it just was a string of data, it would suffice for the e-mail, but since I don't know any php and don't have the time to learn it, I guess this is where it ends for meπ
It would've been really convenient for the purpose of the registration, though. How did the developer who wrote the tutorial consider saving the data for the fields anyway?
But if I got at least the db to save SOME info, it would probably take me a step closer.
Best regards and thanks for the swift reply!
Chris
I don't know exactly how I can store the information, which is part of my question, I guess. When I try to add a new table, it doesn't let me because of the invalid field names that are probably provided through the custom codes:
addone_{$j}
recipient[{$i}][name]
recipient[{$i}][address]
This is highlighted in red when I try to add a table to the form. If it just was a string of data, it would suffice for the e-mail, but since I don't know any php and don't have the time to learn it, I guess this is where it ends for meπ
It would've been really convenient for the purpose of the registration, though. How did the developer who wrote the tutorial consider saving the data for the fields anyway?
But if I got at least the db to save SOME info, it would probably take me a step closer.
Best regards and thanks for the swift reply!
Chris
Hi Chris,
You need to know a little bit about MySQL tables and to work out what you need to do. I've answered this same question a couple of times before here. In most cases if you have repeated input blocks it is not good practice to save them all into the same record. If you do want to do that you need to work out what the names of the submitted inputs will be (using a Debugger action will show you) and add those entries into the Create Table dialogue by hand.
It is better practice to save the main record then save the repeated blocks in a second table, each block on a separate record. They need to be linked to the first record, usually by including the cf_id value from the first record.
Which is the better solution really depends on your application design.
Bob
You need to know a little bit about MySQL tables and to work out what you need to do. I've answered this same question a couple of times before here. In most cases if you have repeated input blocks it is not good practice to save them all into the same record. If you do want to do that you need to work out what the names of the submitted inputs will be (using a Debugger action will show you) and add those entries into the Create Table dialogue by hand.
It is better practice to save the main record then save the repeated blocks in a second table, each block on a separate record. They need to be linked to the first record, usually by including the cf_id value from the first record.
Which is the better solution really depends on your application design.
Bob
This topic is locked and no more replies can be posted.
