Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text field losing focus

Status
Not open for further replies.

gabrielAllen

Programmer
Feb 14, 2001
19
0
0
US
I have a page that has a try-catch and alerts the user if a certain criteria isn't met. This criteria is determined with server-side javascript that is 3rd party code, which cannot be modified.

Anyway, when loading the page, the first text-box should maintain focus after load and any alerts pop, but it does not. Anyway I can force this?
 
Is this what you mean?
Code:
...
}catch(e)
 {
    alert('Unable to connect.');
    [b]document.formName.elementName.focus();[/b]
 }

If so, I tried this and didn't work.
 
Ok, I will do that. In the meantime, the page in questions calls functions from another *.js that is server-side and returns values that the page-level scripts use. Will this jumping around cause the problem?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top