| 发表于:2007-08-20 01:12:241楼 得分:0 |
<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= "增加+ " /> <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> | | |
|