如何使用javascript在Iframe中打开页面内的控件 [英] How to find control from page open inside in Iframe using javascript

查看:246
本文介绍了如何使用javascript在Iframe中打开页面内的控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有



我有一个在iframe内打开的Test.aspx页面。



我在Test.aspx页面上编写了javascript代码,用于查找控件如下



if(strTrim(document.getElementById('txtCompName')。value)=='') {

alert('输入公司名称');

document.getElementById('txtCompName')。focus();

返回false;

}



但不行。



请帮帮我。

Dear all

I have Test.aspx page which is opening inside iframe.

I have written javascript code on Test.aspx page for finding control as follows

if (strTrim(document.getElementById('txtCompName').value) == '') {
alert('Enter Company name');
document.getElementById('txtCompName').focus();
return false;
}

but its not working.

Please help me.

推荐答案

以下是非常类似的问题:

访问iframe内的控件 [ ^ ]
Here is very similar question answered:
Accessing controls inside the iframe[^]


这篇关于如何使用javascript在Iframe中打开页面内的控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆