Javascript examples for jQuery:Form Input
Disable symbols and non-letters in input field
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.6.4.js"></script> <script type="text/javascript"> $(window).load(function(){/*from ww w. ja v a 2 s . c om*/ $('#ItemName').keypress(function (e) { var txt = String.fromCharCode(e.which); if (!txt.match(/[A-Za-z0-9&.]/)) { return false; } }); }); </script> </head> <body> <input id="ItemName" type="text"> </body> </html>