Anda di halaman 1dari 6

How to create a form which saves data into a custom DB table in CF V4

1. Go to the form wizard and create your form, pay attention to change your fields names to something meaningful as this will make it much easier later to browse your saved data.

2. In this tutorial, I will create a form with 3 fields: Profession, Subscribed and Phone, fields names will match fields labels, it's not good to have any spaces or special characters in your fields names, but underscores are ok.

3. Now we have the fields created, we will save our form and go to the forms manager to create the Chronoforms Tutorial ChronoEngine.com

table. 4. Check the form (by ticking the checkbox beside the form name) and click Create table at the top right.

5. Configure your table settings, you can change the table name and enable/disable fields or change fields types or lengths, Chronoforms will auto generate most of this stuff for you, but for perfection we still need to do some tweaks, I will disable the auto generated field for the submit button because we don't need that, I will also change the the field type for the subscribed field to TINYINT since this is perfect for a drop down with Yes/No selections, I will also set its length to 1 since I have set its options earlier to: 0=No 1=Yes

6. Click Save and your table should be created unless you have any problems with it.

Chronoforms Tutorial ChronoEngine.com

7. Attention, if you are using the Easy wizard mode then please note that you only need to go to the Store Data tab where you will be able to configure the DB Save settings, so skip to step 8 now. Cool, now lets go back to the wizard and drag the Show HTML action to the OnLoad event to render our form code, and also drag a DB Save action to the On Submit event to save our data when the form is submitted!

8. Now lets configure the DB save settings, all we have to do here is to change the Enabled setting to Yes and select our table from the Table dropdown list. Chronoforms Tutorial ChronoEngine.com

9. Click Apply then close the popup window then click Save. 10. Now lets test our form.

Chronoforms Tutorial ChronoEngine.com

11. We submitted the form once, lets check the data saved, go to the form manager, tick the form, select the table from the dropdown, then click Show Data at the top right.

12. Here is a list of all records saved in this table, we have only 1.

13. Click the record name and you should be able to see the data saved.

Chronoforms Tutorial ChronoEngine.com

14. This is it! :)

Chronoforms Tutorial ChronoEngine.com

Anda mungkin juga menyukai