양식 제출 방법 1

1473 단어 ext
   ,buttons:[{
			text : ' '
			,handler : login
		}, {
			text : ' '
			,handler : function() {
				FormPanel.loginForm.getForm().reset();
			}
		}]

 
 
function login(){
	if(!FormPanel.loginForm.getForm().isValid()) return;
	FormPanel.loginForm.getForm().submit({
		waitMsg: ' ...',
		waitTitle: ' ',
		url: '../../AdminServlet?method=checkUser',
		method: 'POST',
		success: function(form,action){
			
			Ext.MessageBox.alert(" ",action.result.errors.info);		
		},
		failure: function(form,action){
			Ext.MessageBox.alert(" ",' :'+action.result.errors.info)
		}
	});
}
new Ext.KeyMap(document,{
	key: Ext.EventObject.ENTER,
	fn: login,
	scope: this
})

 
 
서버 측 코드:
String username = request.getParameter("username");
String password = request.getParameter("password");
String authcode = request.getParameter("authcode");
System.out.println(username+password+authcode);
out.write "{ success: true, errors:{info:'okay'} }";

 
오류 메시지를 반환하는 경우:
out.write "{ success: false, errors:{info:'okay'} }";

좋은 웹페이지 즐겨찾기