setting focus on a button

  • Thread starter Thread starter David Cho
  • Start date Start date
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.
 
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
 
Back
Top