多表单中的多页 [英] Mutilple Pages in a Form

查看:120
本文介绍了多表单中的多页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近为一个拥有很少内容,图片和网页的客户建立了一个简单的网站。现在,他们想要一个在他们网站上的表单(非常复杂)。我使用Bootstrap构建了他们的网站,因此,基本的HTML,CSS和PHP就足够了。但是,我无法找到构建这种表单的方法。



以下是表单应该执行的操作:



第一页



显示表单字段让用户输入姓名,电话号码和电子邮件地址。然后,一个提交按钮将他们带到下一页。



第二页

具有制造商名称的下拉列表。根据所选制造商的不同,可以使用另一个列表选择产品。最后的下拉列表可让您选择型号。



第三页
$ b

该页面应显示所选型号唯一的内容。例如,如果在上一页中选择了模型X,则此页面会显示一组唯一的字段。选择Y型,你会得到一组不同的字段。

我会在后面找出如何将所有这些存储到数据库中。但现在,如果您可以帮助构建此表单,我将非常感激。



非常感谢!



所以,你可以在链接页面中处理这些变量。在你的表单中,你可以使用隐藏的输入再次发送另一个页面来处理这些变量。在过程结束时,您可以更新或保存数据库中的实体或实体。


I recently built a simple website for a client having very little content, images and pages. Now, they want a form (a very complicated) one on their website. I built their website using just Bootstrap, so, basics of HTML, CSS and PHP was enough. But, I can't figure out a way of building this form.

Here's what the form is supposed to do:

First Page

Shows form fields to have user enter their Name, Phone Number and Email address. Then, a submit button takes them to next page.

Second Page

Has a dropdown list with names of manufacturers. Depending on the manufacturer chosen, another list lets you choose a product. A final dropdown list lets you select the model number.

Third Page

This page, is supposed to show content unique to the model number chosen. For example, if "Model X" was selected in the previous page, this page displays a unique set of fields. Choose "Model Y" and you get a different set of fields.

I will figure out later how to get all this stored into the database. But for now, I would really appreciate it if you can help build this form.

Thank you so much!

解决方案

You can handle the variables with GET and POST methods also you can save variables in SESSION.

So, when you can handle this variables in the chaining pages. In your forms you might use hidden inputs to send again another page to handle this variables again. At the end of the process you can updat or save your entity or entities in your database.

这篇关于多表单中的多页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆