Re: server click event on enter press

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



> I have just written an applcation in asp.net. In testing i have found
> that the enter key press on a button does not fire a javascript confirm
> prompt. is there anyway i can get this to fire the event when the
> button is selected and enter is pressed.

What I have done in the past for this is to use the onsubmit event of the
form. That way, whether the user clicks the button or presses enter on it,
my onsubmit javascript will still run, and then as a bonus I can optionally
cancel the submit by having my javascript function return false.

--
Peace & happy computing,

Mike Labosh, MCSD

"Mr. McKittrick, after very careful consideration, I have
come to the conclusion that this new system SUCKS."
-- General Barringer, "War Games"


.



Relevant Pages

  • Re: Can I execute a javascript action before uploading a file?
    ... of javascript. ... By default an ASP:Button object can fire an OnClick event to call a ... function back on the server side. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Issues with IE & Prototype/AJAX
    ... What is it then when you fire one or more setTimeout() calls? ... In JavaScript, only one thread runs at a time. ... should be able to cancel the endless loop - but it can't because as ...
    (comp.lang.javascript)
  • Re: How do you fire HTML events using Excel to automate IE?
    ... and helpful replies in "Web Browser Question"! ... Dim MyCtrl as Object ... Unforunately, as you probably realise, this doesn't fire the event. ... should I insert the ".Navigate Javascript" command, ...
    (microsoft.public.excel.programming)
  • Re: showModalDialog fires Page_Load only for first click
    ... > I am using javascript to open a popup window on a ImageButton click. ... > popNew fires. ... If the Page_Load event doesn't fire, then probably the page is loaded from the cache, and no roundtrip is made. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Issues with IE & Prototype/AJAX
    ... What is it then when you fire one or more setTimeout() calls? ... In JavaScript, only one thread runs at a time. ... should be able to cancel the endless loop - but it can't because as ...
    (comp.lang.javascript)