jQuery 与后台交互

function saveOrUpdateOrgOk(){
		$('#orgForm').form('submit', {
			 url :'${pageContext.request.contextPath}/listCfgController/insertorUpdatelistcfg.do?sign=${sign}', 
			 onSubmit : function() {
			 return $(this).form('validate');//对数据进行格式化
			 },
			 success : function(data) {
			 	if(data=='1'){
			 		alert("操作成功");
			 		window.close();//关闭本窗口
			 	}else{
			 		alert("操作失败");
			 	}
				
		 	}
		 });
	
}



方式二:

submit提交:将form表单里面的参数传到后台

var aQuery = $('form:first').formSerialize();  
alert(aQuery); 
$('form:first').resetForm();
$('form:first').ajaxSubmit({  
    type: 'post',  
    url: 'http://localhost:7001/D-switching-center/workSpace/doSubmit.do?'+aQuery,  
    success: function(data){  
        alert('success'); 
    },  
    error: function(XmlHttpRequest, textStatus, errorThrown){  
        alert('error');  
    }  
});
$('form:first').submit();


你可能感兴趣的:(jquery,jquery,form,form,submit,submit)