Skip to main content
Participant
March 23, 2011
Question

Dynamic form creation

  • March 23, 2011
  • 1 reply
  • 667 views

Hi all,

Does anyone know if it is possible using dreamweaver, php and mysql to create a web form dynamically dependant on which database fields are active?

Basically, I have a survey table to collect the data and an active fields table. What I wish to do is have the survey form entry page change automatically dependant on which fields are marked active in the 'active fields' table.

e.g.:

Survey Table:

- Survey Item 1

- Survey Item 2

- Survey Item 3

Active Fields Table:

- Survey Item 1 - True

- Survey Item 2 - False

- Survey Item 3 - True

In the above example a form would be created showing only Survey Items 1 & 3. If 2 was set to true, then the form would show survey items 1, 2 & 3. The created form should allow the user to be able to enter the relevant data which is then saved back to the database.

To make things slighty more complex, it would be great if these fields could be placed in particular areas of the page depending on category type:

e.g.:

Survey Item 4 is added and belongs to Survey Item 1's category (defined in the Active fields table), so would therefore show as;

Survey Item 1

Survey Item 4

Survey Item 2

Survey Item 3

Any ideas, pointers, links or vids would be gratefully received. Thanks in advance.

Regards

Paladindc

This topic has been closed for replies.

1 reply

Participating Frequently
March 23, 2011

Sure, it's possible, but you would need to code this by hand. It's not a good data model.

Take a look at this thread for a better data model:

http://forums.adobe.com/thread/824129?tstart=0

That model would allow you much more flexibility and would be much easier to achieve what you are attempting.