467,188 Members | 1,426 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,188 developers. It's quick & easy.

Set focus on a form control dilemma

Hi,

I have a dilemma. I have a web form that, when submitted, does a
window.open js function to submit the form data to a new aspx page
which then shows a report. I wanted to make sure that the first text
box control had the focus so I added javascript code to set that
focus. The only problem was that the popup window kept opening behind
the parent after the submit. So, I added a document.focus() in the
onload event of the new window. Now, when you hit submit, the parent
keeps the focus (due to the text control focus code) and the child
window will grab the focus shortly after when it begins to load. I am
in a catch-22 situation. How can I set the focus of the first text
box but relinquish the focus of the parent window immediately after
submit. I understand why it is grabbing the focus back for a second
since it is posting back to itself but I don't want it to do it that
way.

Anyone have any ideas?

Thanks, Chris
Nov 17 '05 #1
  • viewed: 883
Share:

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by tshad | last post: by
17 posts views Thread by Neil Ginsberg | last post: by
2 posts views Thread by chris@ckerrison.freeserve.co.uk | last post: by
8 posts views Thread by copyco | last post: by
1 post views Thread by clickon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.