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
Post a Comment