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" <gR*********@hintsandtips.com> wrote in message
news:OJ**************@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:10*************@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" <gR*********@hintsandtips.com> wrote in message
news:%2****************@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!