setting focus on a button

D

David Cho

After the user fills out the webform, my customer would like a default
button on the form to have focus, so that all the user has to do is press
<enter> as opposed to having to take the cursor and click.

The problem is that I have buttons in a user control (its a navigation
control) across the top of the page. So the button in the left upper
corner always has focus, and that is not the button that the customer
wants focused.

Is there a way to handle this? Thank you.
 
N

ns

or Add this to the page_load event

Dim strScript As String
strScript = "<script language=javascript>
document.all('FirstName').focus() </script>"
RegisterStartupScript("focus", strScript)

FirstName would be the control you want to get the focus
 

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,780
Messages
2,569,611
Members
45,277
Latest member
VytoKetoReview

Latest Threads

Top