setting the focus on a textbox

I have multiple textboxes on a page but when the page loads i want to set
the focus on a particulair textbox so a user can fill in the text right away
without having to click on the textbox to focus it.

Advertisements

"Richard" <> wrote in message
news:...
> I have multiple textboxes on a page but when the page loads i want to set
> the focus on a particulair textbox so a user can fill in the text right
away
> without having to click on the textbox to focus it.
>
> Anyone know how?
>
> thx in advance...
>
>

Advertisements

"Richard" <> wrote in message news:...
> I have multiple textboxes on a page but when the page loads i want to set
> the focus on a particulair textbox so a user can fill in the text right away
> without having to click on the textbox to focus it.
>
> Anyone know how?
>
> thx in advance...
>
>

"Richard" <> wrote in message
news:...
> I have multiple textboxes on a page but when the page loads i want to set
> the focus on a particulair textbox so a user can fill in the text right
away
> without having to click on the textbox to focus it.
>
> Anyone know how?
>
> thx in advance...
>
>

"Raterus" wrote:
> Put this in page_load
>
> Page.RegisterStartupScript("setFocus", "<script language='javascript'>document.forms[0].txtBoxID.focus();</script>")
>
> --Michael
>
> "Richard" <> wrote in message news:...
> > I have multiple textboxes on a page but when the page loads i want to set
> > the focus on a particulair textbox so a user can fill in the text right away
> > without having to click on the textbox to focus it.
> >
> > Anyone know how?
> >
> > thx in advance...
> >
> >
>

Umm... That is VB code. If you are asking how to do the script in VB
code, then, although it is possible to run VB script in the IE
browser, you should probably consider using Javascript instead.
Remember, the code shown runs on the server and generates Javascript
code that is ultimately run immediately after the page loads on the
browser. Javascript is the best tool on the browser.

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!