如何处理任意数量的表单字段
我正在使用 ColdFusion (Railo 3.3),并且我有几个使用 jQuery 的表单,可以动态添加一组表单字段(例如,用户可以勾选一个框来添加另一个公司所有者,该框会显示附加的所有相关字段)所有者)。所有信息都需要插入数据库,但我不知道在任何给定时间将提交多少字段。
如何使用 ColdFusion 处理任意数量的字段以插入到数据库中?
谢谢!
I am using ColdFusion (Railo 3.3), and I have several forms using jQuery that can dynamically add a set of form fields (for instance, the user can tick a box to add another company owner that brings up all the relevant fields for the additional owner). All the information needs to be inserted into a database, but I don't know exactly how many fields will be submitted at any given time.
How do I process this arbitrary number of fields to insert into a DB with ColdFusion?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
表单是一种结构,也称为集合。
您可以循环整个表单结构并插入所有字段,您可能需要排除一些字段,例如提交按钮等,但您应该知道其名称。
Form is a structure aka Collection.
You can just loop over the entire form structure and insert all the fields, you will probably need to exclude some like the submit button etc, but you should know the name of this.