Javascript Validation- Disable Enter Button

Lakhangarg
Posted by Lakhangarg under JavaScript category on | Views : 3156
var keyEntry="";
IF(navigator.appName=="Microsoft Internet Explorer")
keyEntry=event.KeyCode;
else
keyEntry=event.which;
if(keyEntry=='13') { return false; }}


Use the above code to disable enter button. suppose you want that when you are typing something in textbox and if you press enter nothing should happen then use this code on keydown event.

Thanks & Regards
Lakhan Pal Garg
Free Code Snippets
http://lakhangarg.blogspot.com/

Comments or Responses

Login to post response