Set focus on a form control dilemma

C

Chris

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top