这是我在firefox中找到的fireBug.
在其他浏览器中是否相同?
如果是这样,原因是什么?
我有一个很长的形式,我已经分成6个步骤.加载表单时,将加载所有步骤,但只能看到第一步.其余的都有CSS,display:none所以它们是隐藏的.当步骤完成并使用Javascript验证时,当前步骤设置为display:none并且新步骤设置为display:block.在最后一步,用户提交表单.但是,正如预期的那样,只display:block提交页面上元素中的字段.元素中的所有已完成字段都将display:none被忽略.
有没有办法提交display:none元素内的字段?
如果没有,还有另一种方法可以达到同样的效果吗?
除非style="display:none"从template=rowdiv中删除,否则此表单上的"提交"按钮不会执行任何操作.为什么??
(name每个表单控件的部分由javascript动态填充,但是,为了简化故障排除,我运行了没有javascript的表单,问题归结为该display标签是否存在).
这就是Chrome控制台所说的:
bundleAn invalid form control with name='' is not focusable.
bundleAn invalid form control with name='label' is not focusable.
bundleAn invalid form control with name='unique' is not focusable
Run Code Online (Sandbox Code Playgroud)
HTML:
<form method="POST" action="/add/bundle">
<p>
<input type="text" name="singular" placeholder="Singular Name" required>
<input type="text" name="plural" placeholder="Plural Name" required>
</p>
<h4>Asset Fields</h4>
<div class="template-view" id="template_row" style="display:none">
<input type="text" data-keyname="name" placeholder="Field Name">
<input type="text" data-keyname="hint" placeholder="Hint">
<select data-keyname="fieldtype" required>
<option value="">Field Type...</option>
</select>
<input type="checkbox" …Run Code Online (Sandbox Code Playgroud)