日期:2014-05-16  浏览次数:20706 次

ext里FormPanel 提交数据后 后台收不到表单数据
FormPanel是放在一个window里的
JS代码如下
JScript code

var formPanel = new Ext.form.FormPanel({
        title: '以下资料为必填',
        defaultType: 'textfield',
        margins:'3 0 3 3',
        cmargins:'3 3 3 3',
        labelAlign:"right",
        bodyStyle:'padding:5px 5px 0',
        url: 'studentServlet?cmd=add',
        frame:true,
        items:[
                {
                    fieldLabel:'学号', 
                    allowBlank:false,
                    name:'sno'
                    
                }, {
                    fieldLabel:'姓名',
                    allowBlank:false,
                    name:'name'
                }, new Ext.form.ComboBox({
                    fieldLabel: '性别',
                    name: 'sex',
                    store: new Ext.data.SimpleStore({
                        fields: ['sex'],
                        data: [['男'], ['女']]
                    }),
                    displayField:'sex',
                    emptyText:'选择你的性别……',
                    mode: 'local',
                    allowBlank:false,
                    selectOnFocus:true,
                    width: 150
                }),  {
                    fieldLabel:"专业方向",
                    allowBlank:false,
                    name:'subject'
                }, new Ext.form.DateField({
                        fieldLabel: '出生年月',
                        name: 'birthday',
                        allowBlank:false,
                        width: 150
                }), {
                    fieldLabel:"联系电话",
                    allowBlank:false,
                    name:'phone'
                }, {
                    fieldLabel:"电子邮件",
                    name:'email', 
                    allowBlank:false,
                     vtype:'email'
                All States in Document",allStates);
}
function outputList(title,states)
{ 
  var out=title;
  var currentState="";
  alert(states.length)
  for(var i=0;i<states.length;i++)
  {    
    currentState=states[i];
    out=out+"\n-"+currentState.childNodes[0].nodeValue;
  }
  //alert(out);
}
</script>
</head>

<body>
<h1>process xml document of u.s. states</h1>
<form action="#">
<br /><br />
<input type="button" value="view all listed states"
  onclick="startRequest('all');" />
<br /><br />
<input type="button" value="view all listed north northern states"
  onclick="startRequest('north');" />
  </form>
</body>
</html>


后台使用servlet,代码比较简单,已经肯定不是后台的错误了。

------解决方案--------------------
此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
楼主【tince】截止到2008-07-03 22:38:06的历史汇总数据(不包括此帖):
发帖的总数量:4 发帖的总分数:10
结贴的总数量:4 结贴的总分数:10
无满意结贴数:3 无满意结贴分:50
未结的帖子数:0 未结的总分数:0
结贴的百分比:100.00% 结分的百分比:100.00%
无满意结贴率:75.00 % 无满意结分率:500.00%
敬礼!
------解决方案--------------------
this.disabled=true; 我觉得是这句话出了问题,删掉就没事了