子視窗調用父頁面js執行個體

來源:互聯網
上載者:User

標籤:style   http   java   color   os   width   

父頁面代碼:

<%@ page contentType="text/html; charset=GBK"%><html><head><meta http-equiv="Content-Type" content="text/html; charset=GBK" /><title>new_page_title</title><script type="text/javascript">      //查詢資訊      function doQuery_new(){     var inputValue = $("#inputValue").val();     alert("doQuery");      }//新增資訊  function doOpen_new(){  var dlg = new Dialog("son_Dialog");  dlg.Width = 450;  dlg.Height = 150;  dlg.Title = "son_Dialog";  //URL為子頁面路徑  dlg.URL = "/smsadmgr/data/black/sonDialog.jsp";  dlg.ShowMessageRow = false;  dlg.parentWindow = window;  dlg.OKEvent = function(){dlg.getIFrame().doSubmit()};  dlg.show();  dlg.OKButton.value ="重新整理";}      </script></head><body onload="doQuery()"><table id="table" align="left" cellSpacing="2" cellPadding="3"border="0"><tr><td class="tdOdd" align="right"><label>手機號碼:</label></td><td class="tdEven"><input type="text" id="inputValue" name="inputValue" value="cwqi_refresh" style="width: 100px" /></td><td class="tdEven" colspan="6">&nbsp;&nbsp;<input type="button"onclick="doQuery_new()" value="查詢" /> <input type="button"onclick="doOpen_new()" value="開啟" /></td></tr></table></body></html>

子視窗代碼:

<%@ page contentType="text/html; charset=GBK"%><html><head><title>son_page</title></head><body onload="fillPhone()"><form name="myForm" id="myForm"><br><table class="txttable"style="text-align: center; margin-left: 3px; margin-right: 3px"><tr><td width="80" align="left">手機號碼:</td><td align="left"><input id="BL_PHONENUM" name="BL_PHONENUM"maxlength="50" value="" style="width: 100px" /><font color="red">*</font></td><td width="80" align="left">證件號碼 :</td><td align="left"><input id="ZJ_NUM" name="ZJ_NUM"maxlength="50" value="" style="width: 100px" /><font color="red">*</font></td></tr></table></form></body><script type="text/javascript">function fillPhone(){document.getElementById("BL_PHONENUM").value="載入填充";//$("#BL_PHONENUM").val("載入填充");}function doSubmit(){var inputValue=document.getElementById("ZJ_NUM").value;if(inputValue==""){alert("證件號碼不可為空");return;}alert(inputValue); var dlg = parent.Dialog.getInstance("son_Dialog");var pframe = dlg.parentWindow;pframe.doQuery();dlg.close();}</script></html>


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.