By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,440 Members | 1,872 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,440 IT Pros & Developers. It's quick & easy.

How to Set focus?

P: n/a
Hi!

Please advise how to set focus on Windows and Web forms please.

I have tried

formp.Control..focus()

But it does not appear applicable.

Please advise!

Imran

Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi

document.forms["FORMNAME"].ELEMENTNAME.focus();
Or
if(document.getElementById)
{
var e = document.getElementById("ELEMENTID");
if(e != null ) e.focus();
}

And you should do this onload event ( Client side )

More info
http://msdn.microsoft.com/library/de...ence_entry.asp

--
Best Regards
Vidar Petursson
==============================
Microsoft Scripting MVP
http://www.microsoft.com/technet/scriptcenter
==============================
"IMRAN SAROIA" <im*************@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi!

Please advise how to set focus on Windows and Web forms please.

I have tried

formp.Control..focus()

But it does not appear applicable.

Please advise!

Imran

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.