我有一个类似这样的表单:
<form id="lista-documentos" method="post">
<input type=... />
<input type="hidden" value="" name="req" />
<input type="hidden" value="" name="documentos" />
</form>
并通过jQuery UI请求用户确认。此外,隐藏参数会根据用户操作获得动态值:
//jQuery modal confirmation
...
$('input[name=documentos]').val(values);
$('input[name=req]').val(6);
$( this ).dialog( "close" );
$('#lista-documentos').submit();
...
除了我在表单声明上使用POST方法之外,一切都很正常。使用GET将参数传递给servlet,但不是在POST中。
Firebug确认在使用POST时,参数不会附加到请求中。
我是不是漏掉了什么?
发布于 2011-11-18 19:17:16
您可以为表单添加名称。
{"error": "Shell form does not validate{'html_initial_name': u'initial-js_lib', 'form': <mooshell.forms.ShellForm object at 0xab9a42c>, 'html_name': 'js_lib', 'label': u'Js lib', 'field': <django.forms.models.ModelChoiceField object at 0xacabb4c>, 'help_text': '', 'name': 'js_lib'}"}
https://stackoverflow.com/questions/8187472
复制