Page.RegisterStartupScript("setFocus", "<script language='javascript'>document.forms[0].txtBoxID.focus();</script>")
--Michael
"Richard" <richard@dotnet.itags.org.nospam.com> wrote in message news:e8ZvBd2bEHA.716@dotnet.itags.org.TK2MSFTNGP11.phx.gbl...
> 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...
>thx, that helped
Richard
"Raterus" <raterus@.spam.org> schreef in bericht
news:eKh8Vn2bEHA.2476@.TK2MSFTNGP09.phx.gbl...
Put this in page_load
Page.RegisterStartupScript("setFocus", "<script
language='javascript'>document.forms[0].txtBoxID.focus();</script>")
--Michael
"Richard" <richard@.nospam.com> wrote in message
news:e8ZvBd2bEHA.716@.TK2MSFTNGP11.phx.gbl...
> 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...
How do I write this code in VB?
Thanks
"Raterus" wrote:
> Put this in page_load
> Page.RegisterStartupScript("setFocus", "<script language='javascript'>document.forms[0].txtBoxID.focus();</script>")
> --Michael
> "Richard" <richard@.nospam.com> wrote in message news:e8ZvBd2bEHA.716@.TK2MSFTNGP11.phx.gbl...
> > 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...
>How do I write this code in VB?
>
>> Put this in page_load
>>
>> Page.RegisterStartupScript("setFocus", "<script language='javascript'>document.forms[0].txtBoxID.focus();</script>")
>
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.
0 comments:
Post a Comment