I have a promotion box where users can input text to send to administrators.
Objectives
- I need to prevent users from inputting links and special characters.
- Users should only be able to input letters
a-z
(case insensitive) and numbers0-9
. - Input is optional.
Sample Code
Documentation
this.$prompt('Enter your message here.', 'Note', {
confirmButtonText: 'OK',
cancelButtonText: 'Cancel',
type: 'Thank You!',
inputPattern: /[A-Za-z0-9]+/,
inputErrorMessage: 'Invalid Message'
}).then(({ value }) => {
// do something...
}).catch(() => {
// do something...
});
Query
What should be the correct value for inputPattern
for the desired functionality mentioned above?