js构建form进行post提交

//构建post方式提交
var form = document.createElement("form");
form.action = "conditionSearch.action";
form.method = "POST";
form.style.display = "none";
//构建input并附加参数
//查询条件
var conditionText = document.createElement("input");
conditionText.setAttribute("name", "${name}");
conditionText.setAttribute("type", "text");
conditionText.value="${value}";

form.appendChild(conditionText);

document.body.appendChild(form);

form.submit();

posted on 2014-07-16 15:00  因胖被判变瘦  阅读(285)  评论(0编辑  收藏  举报