如何提交位于内的输入?
16lz
2021-01-22
The case :
案子 :
<form id='frm' name ='frm' action='test.php'>
<div style='display:none'>
<input type='text' name='name' value ='' />
</div>
<input type='submit' value='Submit' />
</form>
For example , How can i submit the from given above with its inputs ? Issue : The "name" input wont be passed !
例如,我如何提交上面给出的输入?问题:“名称”输入不会传递!
5 个解决方案
#1
6
Programatically, you can just trigger the submit
event on the form element:
以编程方式,您可以在表单元素上触发submit事件:
$('#frm').submit();
Edit: Actually, after reading your markup more carefully, you are using an input
named name
, this element can cause "clashing" problems with the form's name attribute.
编辑:实际上,在仔细阅读标记后,您使用的是名为name的输入,此元素可能会导致窗体的name属性出现“冲突”问题。
Consider changing the name of your input.
请考虑更改输入的名称。
See also:
也可以看看:
- Unsafe Names for HTML Form Controls
- HTML表单控件的不安全名称
更多相关文章
- 提交一个表单(后台生成id),点击保存并一步后切换到下一个tab中,此t
- 如何打开名称中包含特殊字符的文件
- 使用mysql验证在php中登录表单
- 如何在Laravel 5表单请求中使用请求路由参数?
- 防止Ajax创建表单的默认值
- 在PHP和MySQL中同时插入来自多个表单的多个值
- 如何在发送之前更改SOAP请求中的名称空间前缀(皇家邮件 - 发送请
- 如何使用PHP在表单中找到移动复制
- 如果我对名称中方括号的输入使用jQuery serialize(),为什么会出现