Link to home
Start Free TrialLog in
Avatar of BR
BRFlag for Türkiye

asked on

html5 input pattern for some characters

Dear Experts,

How can I prevent my users entering ç,ı,Ş,ş,Ç these characters into my text box?
what pattern should I use?
I'm using html5

<input type="text" name="test" id="test">
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Are you referring to using the input pattern attribute or do you want to actually prevent those char's from even displaying - i.e. use a JavaScript keydown function to cancel the event if it is one of those characters?
Avatar of BR

ASKER

Dear Julian,
JavaScript keydown function would be great? how can I do that?
how can I my users do not enter Ç,ş,ğ characters?
Avatar of BR

ASKER

can I also use html input pattern regex for preventing this?
Avatar of BR

ASKER

I can also use a php replace function to change the characters...
what do you suggest I should do?
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BR

ASKER

Thank you Julian
You are welcome.