Setting focus on control

M

Mike

Hi,

I have a webform with two textboxes and two buttons. I would like to set the focus to the first textbox when the page is displayed. I tried to change the TabIndex, but apparently, it does not have any effect. Any idea on how I could do that?

Thanks
Mike
 
S

Steve C. Orr [MVP, MCSD]

The easiest, most reliable way is client side Javascript:

MyControl.focus();

Here's more info:
http://wp.netscape.com/eng/mozilla/3.0/handbook/javascript/ref_f-g.htm#59872

You might also consider using this free control:
http://www.metabuilders.com/Tools/FirstFocus.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com


Hi,

I have a webform with two textboxes and two buttons. I would like to set the focus to the first textbox when the page is displayed. I tried to change the TabIndex, but apparently, it does not have any effect. Any idea on how I could do that?

Thanks
Mike
 

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,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top