Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   move the <Enter> focus between 2 buttons (http://www.velocityreviews.com/forums/t78725-move-the-enter-focus-between-2-buttons.html)

Rocio 05-20-2004 08:49 PM

move the <Enter> focus between 2 buttons
 
I have a aspx page, with 2 controls (ascx).

Control1 contains a SEARCH button, and textbox to enter the string to
search for.
Control 2 contains a LOGIN button, and 2 text boxes to enter the
username & password to login.
Any user can perform a search, but if he applies for an account, he
can login and performed an enhanced search.

Currently, the SEARCH button responds when the user clicks <Enter>,
which works find if he is doing a search.

But if he has an account and enters his username & passowrd and
presses <Enter> the command goes to the SEARCH button, this case doing
nothing since he did not enter anything to search for.

How can I switch the focus of the <Enter> from SEARCH to LOGIN buttons
in the same page? I'm figuring, when the user focuses in the
txtUserName for example, I would like to change the focus from the
SEARCH button to the LOGIN when he presses <Enter>.

Is this possible? Anyone knows how?

TX! in advance!

Steve C. Orr [MVP, MCSD] 05-20-2004 09:17 PM

Re: move the <Enter> focus between 2 buttons
 
You can intercept the client side enter keypress event of the text box and
then do what you want using javascript code.
Here's a good example:
http://www.kamp-hansen.dk/pages/show...d=21&menuid=18

You could also try using this free control.
http://www.metabuilders.com/tools/DefaultButtons.aspx

And here's a good article on the subject:
http://www.allasp.net/enterkey.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net


"Rocio" <rocio.katsanis@softwareservices.net> wrote in message
news:7b914006.0405201249.7e0b92ee@posting.google.c om...
> I have a aspx page, with 2 controls (ascx).
>
> Control1 contains a SEARCH button, and textbox to enter the string to
> search for.
> Control 2 contains a LOGIN button, and 2 text boxes to enter the
> username & password to login.
> Any user can perform a search, but if he applies for an account, he
> can login and performed an enhanced search.
>
> Currently, the SEARCH button responds when the user clicks <Enter>,
> which works find if he is doing a search.
>
> But if he has an account and enters his username & passowrd and
> presses <Enter> the command goes to the SEARCH button, this case doing
> nothing since he did not enter anything to search for.
>
> How can I switch the focus of the <Enter> from SEARCH to LOGIN buttons
> in the same page? I'm figuring, when the user focuses in the
> txtUserName for example, I would like to change the focus from the
> SEARCH button to the LOGIN when he presses <Enter>.
>
> Is this possible? Anyone knows how?
>
> TX! in advance!




Rocio Katsanis 05-21-2004 02:19 PM

Re: move the <Enter> focus between 2 buttons
 

Tx for your reply Steve.
As a matter of fact yesterday I did more research and found your reply
to a similar issue, pointing to the first link as a solution in this
reply.
It worked fine.

Thanks for the other information links as well.

-r


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


All times are GMT. The time now is 10:45 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.