here is my code for a textareainput to accept only characters not numbers.
var harfInput1 = document.getElementById('graduated_university_country');
harfInput1.addEventListener("keyup",function(){
if (harfInput1.value.match(/[^a-zA-Z' ']/g)){
harfInput1.value = this.value.replace(/[^a-zA-Z]/g,'');
}
})
Problem is i cannot accept Turkish characters like this. I tried to add code below but it did not work.
var harfInput1 = document.getElementById('graduated_university_country');
harfInput1.addEventListener("keyup",function(){
if (harfInput1.value.match(/[^a-zA-Z' '][^\wığüşöçĞÜŞÖÇİ]/g)){
harfInput1.value = this.value.replace(/[^a-zA-Z][^\wığüşöçĞÜŞÖÇİ]/g,'');
}
})
Any suggestions?