I'm trying to implement a custom form builder, similar to those provided by Wufoo and Google.
While I've created a simple UI to create these custom forms with, my issues lie in the database design. Upon creating the form, a JSON implementation is saved in the database (would like to improve this) and referenced to build the form that a user would see.
Upon submission, I'd like to store all of the fields of the form in a database. Following the JSON structure used for designing the database, this is easy enough. However I'd like each individual field to be searchable.
The questions:
- Is there a better way to store the form design?
- What data structures/models would fit storage of the form's results? I've seen that EAV could be a possiblity, but due to the different input types involved (drop-down, checkbox, text, textarea) this may become tedious.
- Which structure would allow easiest searching and permit the use of WHERE clauses? The JSON example given, doesn't allow me to do this quite as nicely