Allow user to enter specific Characters in TextBox using JavaScript

Last Reply 5 months ago By EmadKhan

Posted 5 months ago

Allow only these characters in textbox and restrict other characters from being inserted 

Allow only
alphabets , numbers , left key, right key, backspace key, delete key, forward slash, round brackets (), ampersand, dot, dash, whitespaces 

other characters should be ignored.

You are viewing reply posted by: EmadKhan 5 months ago.
Posted 5 months ago

I found simplest solution :

https://github.com/johnantoni/jquery.alphanumeric

Please visit and download the above plugin :

Using above plugin we can use this jQuery coding to acheive the target:

$('.specialField').alphanumeric({ allow: "-()&/. " });