Allow user to enter specific Characters in TextBox using JavaScript

Last Reply 8 months ago By EmadKhan

Posted 8 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 8 months ago.
Posted 8 months ago

I found simplest solution :

Please visit and download the above plugin :

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

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