dtl4521 2010-08-25 19:45
浏览 186
已采纳

创建动态表单的解决方案

I'm having some trouble deciding which approach I should take. I want to allow users to create their own html forms by choosing different form elements (textfields, textareas, lists, ratios, etc) I guess something similar to http://wufoo.com/ but much more basic. Should I use database tables or create files?

For tables I was thinking to create a table for each form element, e.g

TEXTFIELD TABLE

ID

TEXTFIELD_NAME

USER

...

TEXTAREA TABLE

ID

TEXTAREA_NAME

USER

etc for all form elements

and then just query all of them with..

WHERE user=$user

Or should I generate php files on the server for each form created?

  • 写回答

2条回答 默认 最新

  • dongtang5057 2010-08-25 20:15
    关注

    One approach I used for custom forms on a mobile device was to define a table for field types (eg: text, date, money, custom), a table for form templates (with owner, version, and XML for the template data), and a table for form values (as XML) with a foreign key to the template.

    Someone may create a form template with the available field types, and the collected data may be stored for that template, and optionally by template version. If the database supports it, you could query into the XML data to aggregate fields across forms.

    For presentation, you could use a fixed style, or transform the template or collected fields however desired.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
  • ¥15 安装svn网络有问题怎么办