How to set focus to a control inside frame
- by Geetha
Hi All,
i am using two frames in a page. Mainframe have a page with text box to get input and gives the result url.
Needs:
I want to show this page in the topframe.
I want to set focus to the text box control in the mainframe always. using the following code but giving null error.
parent.frames['mainFrame'].document.getElementById('form1:txtbox').focus();
<frameset rows="550,0" cols="1008" frameborder="NO" border="0" framespacing="0">
<frame src="" id="topFrame" target="topFrame" runat="server" scrolling="no"></frame>
<frame src="Search.aspx" runat="server" id="mainFrame"></frame>
</frameset>