客户端:主要是看我鞋底subm这个函数有没得问题,
var main=new ext.formpanel({ title:'用户注册', width:500, frame:true, bodystyle:'margin:10px;', renderto:'tool', height:400, items:[ { layout:'column', border:false, items:[ { columnwidth:.4, xtype:'textfield', fieldlabel:'姓名', labelwidth:30, regex:/^[0-9a-za-z\.]+$/, regextext:'只能是字母', regextextwidth:300, allowblank:false, name:'name' },{ columnwidth:0.6, layout:'column', bodystyle:'margin-left:20px', border:false, items:[ { columnwidth:.2, xtype:'checkbox', name:'aihao', boxlabel:'足球', }, { columnwidth:.2, xtype:'checkbox', name:'aihao', boxlabel:'踢足球' } ] } ] } ], buttons:[ {text:'保 存', handler:subm}, {text:'取 消'} ] })function subm(){ if (!main.isvalid()) { return; } main.getform().submit({ waitmsg:'数据提交中....', url:'./php.php', method:'post', params:main.getvalues(), success:function(form,action){ alert(ok); }, failure:function(form,action) { alert(''); } }) }
服务端:
xiobai,sex=>28);echo json_encode($arr);?>
问题他直接走failure:后面的函数,为什么不走success:
回复讨论(解决方案) 你 alert(form + action);
而不要 alert('');
你 alert(form + action);
而不要 alert('');
显示出来是两个obj.不知是怎么回事。