1. 程式人生 > >使用JQUERY封裝Form和input進行提交

使用JQUERY封裝Form和input進行提交

	promptConfirm(confirmstr,function(){
		var form=$("<form>");//定義一個form表單
		form.attr("style","display:none");
		form.attr("target","");
		form.attr("method","post");
		form.attr("action",projectPath+'/query/exportExcel.do');
		var input=$("<input>");
		input.attr("type","hidden");
		input.attr("name","param");
		input.attr("value",param);
		var input1=$("<input>");
		input1.attr("type","hidden");
		input1.attr("name","data");
		input1.attr("value",data);
		$("body").append(form);//將表單放置在web中
		form.append(input);
		form.append(input1);
		
		form.submit();//表單提交 
	});