150
rated 0 times
[
155]
[
5]
/ answers: 1 / hits: 22693
/ 9 Years ago, wed, may 13, 2015, 12:00:00
I'm looking to implement the solution provided in this answer but it's not working. The code in this jsFiddle have looks like this:
function Start() {
$('#TheBox').keyup(function () {
var TheInput = $('#TheBox').val();
var TheCleanInput = TheInput.replace(/([.p{L}])/g, '');
$('#TheBox').val(TheCleanInput);
});
}
$(Start);
Basically, I'm looking to allow letters such as é è ô as well as numbers. What do I need to change to make the regex filter work?
More From » jquery