134
Views
5
Comments
Solved
how to restrict user only to enter phonenumber
Question
Application Type
Reactive

Hello everyone,

Im developing reactive app ,

im using input field with phone number and assigning attribute with datatype phone number,

its allowing alphabets also i should restrict user to enter alphabet ,.only digits should enter.

How to achieve this.. 

can some one pls help me here..


Regards.

2023-04-16 15-25-31
Krishnanand Pathak
Solution

Hi @salman Syed ,

I am attaching the OML for your reference.

Click here to check the Demo

I hope it will be Helpful.


Regards,

Krishnanand Pathak

PhoneNumber.oml
2023-08-28 07-00-10
Paulo Torres
Champion

This solution works but you can see the letters if you click on letters and after disappears. Better to have a JS that not allow you to enter any letter.

2025-04-17 05-42-16
Ajit Kurane

Hi Salman,

Here is everything what you are expecting,

I have provide answer with oml file here, you can refer it.

https://www.outsystems.com/forums/discussion/75877/phone-no-regex/

https://www.outsystems.com/forums/discussion/75255/phone-number-validation/

If you want to restrict alphabets then you can use this one,



Thanks,

Ajit Kurane.

2022-07-22 08-49-20
Laura Fidalgo

Hi @salman Syed 

You can always change the input and variable to number and validate on save.

Cheers

2025-12-17 21-10-06
Shlok Agrawal

Generally phone number contains some special characters like +121, +91. 

If you are not concerned with country code set the datatype to integer and limit the number of digits.

If you want country code just simply make 2 containers, 1st add dropdown for country code with country name representing it. 2nd add input parameter with datatype integer. (Corresponding changes will be required in the Entity attributes)

2023-04-16 15-25-31
Krishnanand Pathak
Solution

Hi @salman Syed ,

I am attaching the OML for your reference.

Click here to check the Demo

I hope it will be Helpful.


Regards,

Krishnanand Pathak

PhoneNumber.oml
2023-08-28 07-00-10
Paulo Torres
Champion

This solution works but you can see the letters if you click on letters and after disappears. Better to have a JS that not allow you to enter any letter.

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