tags:

views:

61

answers:

1

Hi,

I am trying to Focus on a control in Load of my page in Classic ASP Application.

My page is calling inside a main page written inside IFRAM.

Problem: When I am tryting to load my Sub-Page I could not able to focus on Control on "OnLoad" Event.

Could you please let me know any solution.

Thanks,

+1  A: 

Are you getting an error message? Try adding this at the very bottom of your page:

<script type="text/javascript">
    document.getElementById("myElement").focus();
</script>
Chris Pebble
It is working for Main Page. But it is not working for Child page, and I am calling this page using IFRAM. Thanks,
Suman
An IFrame is a separate entity which the page itself is not aware of. I would guess that you are setting focus on an Ad or something of that nature. In order to set the focus you would need to have that Javascript on the page that you are IFraming.
David
Hi Deivd,Thanks for your suggestion. I have tried that way as well. But it could not work at all.Thanks,
Suman