User should not able to type character except number

1
Hi, I am trying to validate mobile number validation, but while validating input field should not able to type character except number. Please check below screen shot for your reference.      Advance appreciate for this   Thanks 
asked
4 answers
0

You can take a look at using a regular expression. Documentation can be found here.

Hope this helps.

answered
0

Hi Ganesh,

You can add OnChange event microflow. In that microflow add condition to check regular expression and show validation message. You can check by following link. 

 Regular Expression to validate numeric value

This will work for you.

answered
0

Hi Ganesh! There are two ways to do this:

  1. Use iMask widget
  2. Write javascript which loads through a nanoflow. Execute this nanodlow through an 'On enter' event on the text box.
    • Your javascript should listen to keydown event on that particular field.
    • If the keydown value isn't a number, then reject it.

Example js code:

document.getElementById("myInput").addEventListener("keydown", function(event) {

if (!/^[0-9]+$/.test(event.key)) {

event.preventDefault();

}

});

answered
-1

Maybe you could look with this question too since you have the same concerns.

 

https://forum.mendix.com/link/space/app-development/questions/128935

answered