PDA

View Full Version : How can I get element from IFrame ?



quantw
24 Aug 2007, 2:19 AM
Hi folks,

I have some code following:
+ In default.js page

myIframe = Ext.getDom('myFrame_id');
myIframe.src = mypage.aspx;

+ In mypage.aspx page contains checkboxs declared in mypage.aspx.cs file following:

HtmlInputCheckBox box = new HtmlInputCheckBox();
box.Name = "chk"; box.ID = "chk";

I got checkbox following but it doesn't work.

var checkboxs = myIframe .document.getElementsByName('chk');

How can I get checkbox based on id or Name ?

Help me, please !
Quan.

Neo
24 Aug 2007, 2:43 AM
It seems you did not search the forum. Just search "iframe" and you will find a mini-guide written by me about accessing elements that are inside iframes and you will easily solve the problem.

A part from that, this does not seem to be the very best way to get help. I recommend you read the topic (sticky) about "how to get help".

Hope it to be useful, Neo.

quantw
26 Aug 2007, 8:19 PM
I found answer for my problem following:
we can't get element from myIframe that should be :

myFrame_id.document.getElementsByName('chk');

I lost many time for small this code :-).