function submitTo(type){
var obj=document.getElementById("form");
if(type==1){
obj.action="exportBusiness";
obj.enctype="application/x-www-form-urlencoded";
obj.method="get";
}
else if(type==2){
obj.action="importBusiness";
obj.enctype="multipart/form-data";
obj.method="post";
}
obj.submit();
}
var obj=document.getElementById("form");
if(type==1){
obj.action="exportBusiness";
obj.enctype="application/x-www-form-urlencoded";
obj.method="get";
}
else if(type==2){
obj.action="importBusiness";
obj.enctype="multipart/form-data";
obj.method="post";
}
obj.submit();
}
本文介绍了一种通过JavaScript实现的表单提交方式切换方法。该方法允许用户根据需求选择不同的表单提交类型,如GET或POST,以及不同的提交路径。此外,还介绍了如何设置表单的enctype属性以支持文件上传。
261

被折叠的 条评论
为什么被折叠?



