extjs form提交表单


博客分类:


 

function submit1(){
if(loginForm.form.isValid()){    
   loginForm.form.doAction('submit',{
      url:'loginAction.action',
      method:'post',
      success:function(form,action){
          alert("afsdfsdf");         
      var result=action.result.data;
      
      if(result=='a'){
       //跳转到高级管理员界面
          window.location.href = 'adminer.html'; 
      }else if(result=='d'){
        //跳转到开发人员界面
          window.location.href = 'developer.html'; 
      }else if(result=='t'){
           //跳转到测试人员界面
      window.location.href = 'tester.html'; 
      }else if(result=='p'){
           //跳转到项目经理界面
      window.location.href = 'manager.html'; 
      }else{    
       Ext.Msg.alert('错误',"用户名或密码错误");
      }
     },
     failure:function(form,action){
         Ext.Msg.alert('错误',"用户名或密码错误");
     }
    });
}