qontu / ngx-inline-editor

Native UI Inline-editor Angular (4.0+) component
https://qontu.github.io/ngx-inline-editor
MIT License
164 stars 90 forks source link

How to prevent special character in input box #141

Open arya-himanshu opened 6 years ago

arya-himanshu commented 6 years ago

How to prevent special character in input box

sanatani9 commented 6 years ago

you can use pattern and (onError) for that. P.S: this will not prevent special character. But will execute myHandleError($event) and you can write you required code there.

<inline-editor type="text" [(ngModel)]="editableText" (onSave)="saveEditable($event)" name="editableText1" size="8" disabled="true" min="1" max="8" pattern="^[a-zA-Z]{1,3}" (onError)="myHandleError($event)"></inline-editor>