表单提交按钮不传递值
问题描述:
我有一个基本的表单,其中包括3个提交按钮。表单提交按钮不传递值
<form action="/signups/wizard/location" id="SignupForm" method="post" accept-charset="utf-8">
<div style="display:none;"><input type="hidden" name="_method" value="POST"></div>
Street: <input name="data[Location][street]" maxlength="200" type="text" value="">
Apartment: <input name="data[Location][apartment]" value="">
City:<input name="data[Location][city]" maxlength="50" type="text" value="">
<div class="submit">
<input name="Previous" type="submit" value="Previous">
<input type="submit" value="Continue">
<input name="Cancel" type="submit" value="Cancel">
</div>
</form>
当我提交表单,我预期的提交按钮将其数据传递到$ _POST输入字段,但是我只看到位置在数组中。
这里是$ _ POST的内容:
array(
'_method' => 'POST',
'data' => array(
'Location' => array(
'street' => '',
'apartment' => '',
'city' => ''
)
)
)
UPDATE 我禁用了JavaScript和值出现在$ _ POST。有没有简单的方法来确定哪些脚本可以删除它?
答
发现罪魁祸首,此JavaScript已包含在每个页面上由以前的开发人员。
$('form').submit(function(){
$('input[type=submit]', this).attr('disabled', 'disabled');
});
Arg!只是做了完全相同的事情!感谢您发布您的解决方案:-) – DilbertDave 2013-03-08 15:32:22