1264
Views
5
Comments
Solved
Restrict special characters in input field
Question

want to allow only alphanumeric keys in input field. 

2021-03-18 21-03-15
Benjith Sam
 
MVP
Solution

Hi Poonam,

One more solution:

1) Add the below JS script to the Input widget --> onkeyup extended property as shown below

onkeyup="this.value=this.value.replace(/[^a-zA-Z0-9]/g, '')"

Hope this helps you!


Regards,

Benjith Sam

UserImage.jpg
Poonam Verma

Benjith Sam wrote:

Hi Poonam,

One more solution:

1) Add the below JS script to the Input widget --> onkeyup extended property as shown below

onkeyup="this.value=this.value.replace(/[^a-zA-Z0-9]/g, '')"

Hope this helps you!


Regards,

Benjith Sam

 working fine in traditional but how to do it in Reactive.

 

2021-02-02 11-55-27
Tushar Panpaliya
2021-03-18 21-03-15
Benjith Sam
 
MVP
Solution

Hi Poonam,

One more solution:

1) Add the below JS script to the Input widget --> onkeyup extended property as shown below

onkeyup="this.value=this.value.replace(/[^a-zA-Z0-9]/g, '')"

Hope this helps you!


Regards,

Benjith Sam

UserImage.jpg
Poonam Verma

Benjith Sam wrote:

Hi Poonam,

One more solution:

1) Add the below JS script to the Input widget --> onkeyup extended property as shown below

onkeyup="this.value=this.value.replace(/[^a-zA-Z0-9]/g, '')"

Hope this helps you!


Regards,

Benjith Sam

 working fine in traditional but how to do it in Reactive.

 

2018-09-27 18-20-33
Swatantra Kumar
Champion

Hi Poonam,

The simplest and fastest (performance-wise) way is to use the regular expression. 

^[a-zA-Z0-9]*$ It matches any alphanumeric string (no spaces).

Description:

^ : start of string
[ : beginning of character group
a-z : any lowercase letter
A-Z : any uppercase letter
0-9 : any digit
] : end of character group
* : zero or more of the given characters
$ : end of string

Regards,

Swatantra

UserImage.jpg
vs088

Hi All

I am  also facing an issue related to input fields for Mobile Applications.

I have a scenario where I have two input controls. One input  to allow only integer values and second one restrict special characters. Its for mobile app. How to handle it  . Can it will be possible to handle without using any forge component. Please suggest solution for this. Thanks in advance.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.