在Iframe中获取父窗口中表单的值(示例代码)_技术学院_宜昌市隼壹珍商贸有限公司

您好,欢迎访问宜昌市隼壹珍商贸有限公司

400 890 5375
当前位置: 主页 > 新闻动态 > 技术学院

在Iframe中获取父窗口中表单的值(示例代码)

发布时间:2026-01-17  |  点击率:

部分代码如下:  
  <from   name="frm"   action="bb.asp">  
  <table>  
      <tr>  
            <td><input   type="text"   name="BH"></td>  
      </tr>  
      <tr>  
              <td><iframe   name="ScrollFrame"   src="aa.asp"   width="100%"></IFRAME></td>  
      </tr>  
  </table>  
  </form>  

问题:如何在aa.asp中判断表单(frm)中输入框(BH)的值是否为空?

-----------------------------------

aa.asp文件测试代码  

----------------------------------------------  

  <script   language="javascript">  
  function   show(){  
  if(document.parentWindow.parent.document.getElementsByName("BH")[0].value=="")  
        alert("空的");  
  else  
        alert("不空");  

  }  

  </script>  

  <input   type="button"   value="show"   onclick="show();">

全国统一服务电话

400 890 5375

电子邮箱:879577@qq.com

公司地址:宜昌市西陵区黄河路5号三峡明珠10栋1051室

咨询微信

TEL:13680874598