0
我想提交一个表单使用jjRoutes在Ajax后首先使用jQuery表单验证插件进行验证输入。问题是,当我将“data:form”添加到ajax调用的参数时,响应处理程序从不会被调用。一些代码进一步解释问题:ajax提交表单在播放框架
jsRoutes.controllers.Application.authenticate().ajax({
data : {
form : this //this messes things up!
},
success : function(data) {
window.location = "/"; //never called with the above data stuff
},
error : function(err) {
alert(err); //never called with the above data stuff
}
});
我能够读取控制器中的表单域。当然,一种解决方案是将表单中的每个字段手动提取到数据部分(如下所示),但这不是期望的。还有其他解决方案吗?
data : {
username : <username from form>
password : <password from form>
},
谢谢!那正是我想念的东西!); – 2012-08-12 12:11:29