javascript - How to allow certain characters in input field -


how can allow "a-za-z0-9 &#$._-" along "/" . tried jquery

$('.allow').bind('keyup blur',function(){      $(this).val( $(this).val().replace(/[^a-za-z0-9 &#$._-]/g,' ') ); }  ); 

along need allow forward slash "/".

can please me out. great help.

use ^ , $ outside of []. match allowed characters.

you need escape / , - in regex

/^[a-z0-9 &#$._\-\/]$/i 

Comments

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Using jquery append to add option values into a select element not working -

javascript - Restarting Supervisor and effect on FlaskSocketIO -