Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

Conflict event handling.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
zlf - 12 Mar 2008 09:24 GMT
Hello
Currently, I'm using javascript to respond the "ENTER" button press event in
my ASPNET page.
It works fine when there is no multi-line textbox, but when multi-line
textbox is presented in page, and user enters "ENTER" button, both of my
javascript and textbox responses it.
It is unexpected. How can I ask my javascript to ignore it in this case or
ask TextBox to accept ctrl+enter as "ENTER".

   <script type="text/javascript">
   function keyDown()
   {
       var keycode=event.keyCode;
       if(keycode==13){
           event.keyCode=65;
           __doPostBack('ctl00$ctl00$SsnContentPlaceHolder$SearchButton','');
       }
   }
   document.onkeydown=keyDown;
   </script>

Thanks
Eliyahu Goldin - 12 Mar 2008 13:18 GMT
Instead of handling onkeydown event for document, do it for the textbox:

myTextbox.Arrtibutes["onkeydown"] = "keyDown()";

Signature

Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net

> Hello
> Currently, I'm using javascript to respond the "ENTER" button press event
[quoted text clipped - 19 lines]
>
> Thanks
zlf - 12 Mar 2008 15:29 GMT
It works!
Thank you!

"Eliyahu Goldin" <REMOVEALLCAPITALSeEgGoldDinN@mMvVpPsS.org> дÈëÏûÏ¢ÐÂÎÅ:ekHTatDhIHA.5820@TK2MSFTNGP04.phx.gbl...
> Instead of handling onkeydown event for document, do it for the textbox:
>
[quoted text clipped - 23 lines]
>>
>> Thanks

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.