I have been working on a react form and I need to restrict users to put special characters and allow only these ones: [A-Za-z].
I have tried the below code but I am still able to insert inside special characters such as: '♥', '>', '+', etc.
export default Component (props {
...
return (
<input
pattern={props.pattern}
/>
)
}
And I am sending it as a prop to my form:
<Component
pattern="[A-Za-z]+"
/>
Can you let me know what I am missing and point out what could be the issue? Many thanks.