I would like to allow users to create custom forms in a CMS I am building. While on a broader level, it seems to be quite simple, let the user create the form and save it, the little details seems to be much more complicated.
I have identified 2 main ways.
User creates the form in a seperate form module. He then visits the pages module and adds the form to that page. This is similiar to how cform II works in wordpress.
User creates a page. A form button allows them to add a form inline using the rich text editor. This probably the most straight forward, with the task being focused towards what they are trying to archieve (create a page with a form).
Option 2 raises these issues:
From the program perspective, each form is saved into a database table which contains all the forms in the application. When the user creates forms in a page, the forms are stored into another object, and a place holder is left in the page. Here's what a page could look like:
<p>Some text goes here</p> <span class="">FORMID GOES HERE</span>
If the user creates a form in a page, and then discards the whole page, then the form is discard.
If the user comes back to the page after publishing the page and deletes the form, what should be done with the form? Should the data collected from the form be deleted as well?
Option 1 is the easiest to implement, but at the same time, it might seem confusing to users. From the user's point of view, all they want is to create a page with a form inside. They do not think about creating a form, and then inserting it into a page.
Option 2 seems to be the most user friendly, but it also introduces more complexity. At the same time, they would need to visit the "forms module" to retrive the data anyway. This may result in some confusion as well.
What's the best way? If you have implemented user definable forms in your application, please let me know what approach you took! :)