模式对话框

xiaoxiao2025-12-09  4

1.弹出对话框的页面: <%@page contentType="text/html;charset=GBK"%> <%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> <body> This is a ModelDialogBox Test!<br/> <form action=""> <input type="text" name="ss1" value=""/> <input type="text" name="ss" value=""/> </form> <button οnclick="t()">TEST</button> <button οnclick="t1()">TEST1</button> </body> <script type="text/javascript"> function t() { var arr = window.showModalDialog('2.jsp','', "dialogHeight:800px; dialogWidth:500px; dialogLeft:(screen.availWidth/2-100); dialogTop:(screen.availHeight/2-50);center: yes;help:no;resizable:no;status:yes"); document.forms[0].ss.value = arr[0]; } function t1() { var arr = window.showModalDialog('3.jsp','', "dialogHeight:800px; dialogWidth:500px; dialogLeft:(screen.availWidth/2-100); dialogTop:(screen.availHeight/2-50);center: yes;help:no;resizable:no;status:yes"); alert(arr.length); var v = ""; var v1 = ""; for(var i=0;i<arr.length-1;i++)//arr.length-1 { if(i%2!=0) { v = v+arr[i].toString()+" ";//Name }else{ v1 = v1+arr[i].toString()+",";//ID } } var i = arr[arr.length-1]; alert(i); document.forms[0].ss.value = v; document.forms[0].ss1.value = v1; } </script> 2.用于访问后台的页面: <%@page contentType="text/html;charset=GBK"%> <% response.setHeader("Cache-Control","no-store"); response.setHeader("Pragrma","no-cache"); response.setDateHeader("Expires",0); %> <body> <iframe src="<%=request.getContextPath() %>/tree!query.action" frameborder="1" height="100%" name="kkk" scrolling="auto" width="100%"></iframe> </body> <%@page contentType="text/html;charset=GBK"%> <% response.setHeader("Cache-Control","no-store"); response.setHeader("Pragrma","no-cache"); response.setDateHeader("Expires",0); %> <body> <iframe src="<%=request.getContextPath() %>/tree!test.action" frameborder="1" height="100%" name="kkk" scrolling="auto" width="100%"></iframe> </body> 3.模式对话框: <%@ page language="java" contentType="text/html;charset=GBK"%> <%@ taglib prefix="ww" uri="webwork"%> <form> <table> <ww:iterator value="list" status="status"> <tr><td><INPUT TYPE="checkbox" NAME="aa" value="<ww:property value="privilege_id"/>,<ww:property value="name"/>"></td> <td><ww:property value="name"/></td> </tr> </ww:iterator> </table> </form> <A HREF="javascript:save()">保存</A> <SCRIPT LANGUAGE="JavaScript"> <!-- function save() { var tpurl=document.forms[0].aa; var m ; var returnArray= new Array(); //alert(tpurl.length); for (var i=0;i<tpurl.length;i++) { if(tpurl[i].checked==true) { m=tpurl[i].value; var ar = new Array(); ar = m.split(","); returnArray.push(ar[0]); returnArray.push(ar[1]); } } var i = 1; returnArray.push(i); if(m=="") { alert("请选择人员!"); }else{ //var returnArray= new Array(); //returnArray = m.split(","); alert(returnArray.length); window.returnValue = returnArray; window.close(); } } </SCRIPT> <%@ page language="java" contentType="text/html;charset=GBK"%> <%@ taglib prefix="ww" uri="webwork"%> <HTML><HEAD> <link href="<%= request.getContextPath() %>/css/dtree.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="<%=request.getContextPath()%>/js/dtree.js"></script> </HEAD> <BODY bgColor=#DDF0FB leftMargin=0 topMargin=0 marginwidth="0" marginheight="0"> <table width="90%" border="0" cellspacing="1" cellpadding="2" align="center" > <tr> <div class="dtree"> <script type="text/javascript"> d = new dTree('d'); <ww:iterator value="list" status="status"> <ww:if test="parent_id == null"> d.add('<ww:property value="privilege_id"/>',-1,'<ww:property value="name"/>'); </ww:if> <ww:else> <ww:if test="islink == \"1\""> d.add('<ww:property value="privilege_id"/>','<ww:property value="parent_id"/>','<ww:property value="name"/>','<ww:property value="url"/>','<ww:property value="url"/>','right'); </ww:if> <ww:else> d.add('<ww:property value="privilege_id"/>','<ww:property value="parent_id"/>','<ww:property value="name"/>'); </ww:else> </ww:else> </ww:iterator> document.write(d); </script> </div> </tr> </table> <FORM name ="" METHOD=POST ACTION=""> <INPUT TYPE="radio" NAME="aa" value="成功,2,3"> <INPUT TYPE="radio" NAME="aa" value="失败,4,6"> </FORM> <button οnclick="guanBi()">close</button> </BODY> <script type="text/javascript"> function guanBi() { var tpurl=document.forms[0].aa; //alert(tpurl.length); for (var i=0;i<tpurl.length;i++) { if(tpurl[i].checked==true) { var m=tpurl[i].value; } } alert(m); if(m=="" || m==null) { alert("请选择人员!"); }else{ var returnArray= new Array(); returnArray = m.split(","); window.returnValue = returnArray; window.close(); } } </script> </HTML> 相关资源:敏捷开发V1.0.pptx
转载请注明原文地址: https://www.6miu.com/read-5040572.html

最新回复(0)