<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
function add(){
var div=document.createElement("div");
div.style.position="absolute";
div.style.left="0px";
div.style.top="0px";
div.style.width="1400px";
div.style.height="600px";
div.style.backgroundColor="black";
div.style.filter="alpha(opacity=40)";
div.style.opacity=.4;
div.setAttribute("id","div");
var div2=document.createElement("div");
var input1=document.createElement("input");
input1.type="text";
input1.value="input";
input1.setAttribute("id","test");
div2.appendChild(input1);
var input2=document.createElement("input");
input2.type="button";
input2.value="提交";
input2.onclick=subs;
div2.appendChild(input2);
var input3=document.createElement("input");
input3.type="button";
input3.value="取消";
input3.onclick=cancel;
div2.appendChild(input3);
var c=document.createElement("center");
c.appendChild(div2);
div.appendChild(c);
document.body.appendChild(div);
}
function subs(){
var a=document.getElementById("test").value;
window.location.href="http://www.baidu.com/s?wd="+a;
}
function cancel(){
var p=document.getElementById("div");
document.body.removeChild(p);
}
</script></head><body>
<input type="button" onclick="add()" value="add">
</body>
</html>这样试试 以post方式提交的话  给文本框加个name直接submit,在后台根据name获取值试试