Javascript 如何创建html清单表单

Javascript 如何创建html清单表单,javascript,html,forms,Javascript,Html,Forms,我正在努力创建清单表单 如何创建html清单表单 例如: 下拉菜单,我可以从中选择供应商 当我选择一个特定的供应商时,它应该加载该供应商的数据: “我们提前付款吗?”和“输入单选”按钮。 如果且仅当单击此按钮时,它应加载更多选项: option1: - 'Is invoice more than than 100 dollars?' and a 'Input Radio' button. If, and only if, this button is clicked it should l

我正在努力创建清单表单

如何创建html清单表单

例如:

下拉菜单,我可以从中选择供应商

当我选择一个特定的供应商时,它应该加载该供应商的数据:

“我们提前付款吗?”和“输入单选”按钮。 如果且仅当单击此按钮时,它应加载更多选项:

option1:    - 'Is invoice more than than 100 dollars?' and a 'Input Radio' button.
If, and only if, this button is clicked it should load some more options:
    'Add special terms' followed by a 'Input(checkbox)'
    'Inform supplier' followed by a 'Input(checkbox)


option2:    - 'Special attention required?' and a 'Input Radio' button.
If, and only if, this button is clicked it should load some more options:
    'special terms applied' followed by a 'Input(checkbox)'
    'supplier contacted by phone' followed by a 'Input(checkbox)'
    'email sent to supplier' followed by a 'Input(checkbox)'

option3:    'Invoice created' followed by a 'Input(checkbox)'
在底部应该有一个“提交”按钮。当我点击它时,如果所有的复选框都被选中,它应该会选中


请帮忙。。。感谢

一种简单的方法是使用页面上的事件在事件发生时动态呈现内容。您可以使用本机文档侦听器或JQuery构建事件侦听器。使用JQuery,您可以定义第一个下拉列表,这是一个供应商列表,带有一个标识符,例如,id=supplier,并调用一个函数,该函数在supplier框上发生选择事件时发生,该事件在页面上插入下一个控件,并填充适当的数据


JQuery文档在这里特别有用。不幸的是,这个问题非常广泛,答案取决于页面的结构,如果您使用的是客户端框架等等,但在我看来,您要寻找的是一个事件驱动的表单。我希望这为您指明了正确的方向。

我们不为您编码-我们帮助您改进代码或发现代码中的缺陷。但在任何情况下,你都需要先做你的工作。