<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
 </HEAD>
 <BODY>
      <script language="javascript" type="text/javascript">
         var i=0;
         function addTxt()
            {
   i=i+1;
             var str = '<p><input type="text" name="txt"+i /></p>'
             document.getElementById('FileCollection').insertAdjacentHTML("beforeEnd",str)

            }
function save(){
var list = document.getElementsByTagName("input");
var textlist = new Array();
for (var i=0 ; i<list.length ; i++){
var input = list[i];
if (input.id != "add" && input.id != "save"){
textlist.push(input);
}
}
var param=new Object();
param.textlist = textlist;

openSimDialog('aa.html',600,300,null,param);
}
function openSimDialog(url, width, height, returnFunc, args) {
if(args == null)
args = new Object();
args.parentWindow = self;
if (typeof window._curUsr!='undefined'){
args._curUsr=window._curUsr;
}
var sfeatures = "dialogHeight: " + height + "px;" + "dialogWidth: " + width + "px;";
window.showModalDialog(url, args, sfeatures);
}
 </script>
<div id="FileCollection">
   <input onclick="addTxt()" id='add' type="button" value="增加+" />&nbsp;
   <input onclick="save()" id='save' type="button" value="保存" />
 </BODY>
</HTML>===============================================================================
===============================================================================
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>用户登录</title>
<script type="text/javascript">
window.onload = function(){
initParameter();
var textlist = _param.textlist;
for (var i=0 ; i<textlist.length ; i++){
alert(textlist[i].value);
}
}
function initParameter() {
if(window._param == undefined && window.dialogArguments != undefined) {
window._param = window.dialogArguments;
window._parent = _param.parentWindow;
if (typeof _param._curUsr != 'undefined')
{
window._curUsr=_param._curUsr;
}
}
}
</script>
</head>
<body >
</body>
</html>