Re: Quick question on Default button..

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Rocky Moore (gRockyMoore_at_hintsandtips.com)
Date: 08/02/04


Date: Sun, 1 Aug 2004 22:39:37 -0700

Thanks, that is real close to what I ended up with. Found the example MSDN
for a hot key. Made a tip of it as:

http://www.hintsandtips.com/ShowTip/106/hat.aspx

Just not sure how it will work if a person is in a text area control that
normally uses the ENTER Did not have the time to test.

Thanks again for your posts!

-- 
Rocky Moore
www.HintsAndTips.com / Share your tips - Earn rewards
www.MyQuickPoll.com  / 2004 Election poll ID #33
www.GotTheAnswerToSpam.com / Block virtually all spam email
www.RJSoft.com/Products/RJContentPanel/ - Free web user template content
control!
"S. Justin Gengo" <sjgengo@aboutfortunate[no-spam].com> wrote in message
news:10gqvj2qh2ilhf4@corp.supernews.com...
> Rocky,
>
> If you want a specific button clicked when the user could be anywhere on
the
> page combine the other script with this one:
>
> <script language="JavaScript">
> <!--
> if (document.layers) document.captureEvents(Event.KEYPRESS); // needed if
> you wish to cancel the key
>
> document.onkeyup = keyhandler;
>
> function keyhandler(e) {
> if (document.layers)
> Key = e.which;
> else
> Key = window.event.keyCode;
> if (Key != 0)
> alert("Key pressed! ASCII-value: " + Key);
> }
> //-->
> </script>
>
> -- 
> Sincerely,
>
> S. Justin Gengo, MCP
> Web Developer / Programmer
>
> www.aboutfortunate.com
>
> "Out of chaos comes order."
>                             Nietzsche
> "Rocky Moore" <gRockyMoore@hintsandtips.com> wrote in message
> news:OJtuDkBeEHA.3840@TK2MSFTNGP10.phx.gbl...
> > Opps.  Spoke before I looked.  That is only for a specific text box, I
am
> > looking for one that will work for all controls on the page, not adding
> code
> > to every one.
> >
> > -- 
> > Rocky Moore
> > www.HintsAndTips.com / Share your tips - Earn rewards
> > www.MyQuickPoll.com  / 2004 Election poll ID #33
> > www.GotTheAnswerToSpam.com / Block virtually all spam email
> > www.RJSoft.com/Products/RJContentPanel/ - Free web user template content
> > control!
> >
> >
> > "S. Justin Gengo" <sjgengo@aboutfortunate[no-spam].com> wrote in message
> > news:10gql0srhg4so32@corp.supernews.com...
> > > Rocky,
> > >
> > > TextBox.Attributes.Add("onkeydown", "javascript:if((event.which &&
> > > event.which == 13) || (event.keyCode && event.keyCode ==
> > > 13)){document.Form1." & Button.ClientID & ".click();return false;}else
> > > return true;")
> > >
> > >
> > > -- 
> > > Sincerely,
> > >
> > > S. Justin Gengo, MCP
> > > Web Developer / Programmer
> > >
> > > www.aboutfortunate.com
> > >
> > > "Out of chaos comes order."
> > >                             Nietzsche
> > > "Rocky Moore" <gRockyMoore@hintsandtips.com> wrote in message
> > > news:%23YxwUp$dEHA.2352@TK2MSFTNGP09.phx.gbl...
> > > > Been a while since I looked into this and have forgotten how to make
> the
> > > > ENTER default to a LinkButton and it does on a standard button.  If
I
> > > > remember correctly it required javascript.
> > > >
> > > > Thanks
> > > >
> > > > -- 
> > > > Rocky Moore
> > > > www.HintsAndTips.com / Share your tips - Earn rewards
> > > > www.MyQuickPoll.com  / 2004 Election poll ID #33
> > > > www.GotTheAnswerToSpam.com / Block virtually all spam email
> > > > www.RJSoft.com/Products/RJContentPanel/ - Free web user template
> content
> > > > control!
> > > >
> > > >
> > >
> > >
> >
> >
>
>

Quantcast