cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper IV
Helper IV

Text input mode - number, blocked decimal comma

Hi,

 

I'm building an app where I need a decimal number from an user. I've tried setting the textinput's mode to Number to make things easier, but some users have reported that the button for decimal comma or dot is disabled:decimal.jpg

 

Is there anything else I have to enable, to allow users to input decimal numbers?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User III
Dual Super User III

Re: Text input mode - number, blocked decimal comma

Hi @jernejp 

 

You can modify your regex as: 
 
Set(resetvar,false);Set(resetvar,If(IsMatch(TextInput1.Text,"^[1-9]\d*([.,]\d+)?$"),false,true))
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

5 REPLIES 5
Highlighted
Dual Super User III
Dual Super User III

Re: Text input mode - number, blocked decimal comma

Hi @jernejp 

 

Currently Text Input controls only supports two formats, Text and Number and there are few restriction on various devices types over the keyboard controls.
 
If you want user to restrict to only enter decimal points, as a workaround you can follow the below mentioned steps:
 
1) Keep the Text Format to Text.
2) Set the OnChange property of your Text Input( lets say TextInput1) as:
Set(resetvar,false);Set(resetvar,If(IsMatch(TextInput1.Text,"^[1-9]\d*(\.\d+)?$"),false,true))
3) Set the "reset" property of your text Input as: 
resetvar
 
This will reset the control if user has given value that is not a decimal.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Highlighted
Helper IV
Helper IV

Re: Text input mode - number, blocked decimal comma

Thank you for your answer. Can you help me modify the regex to include a comma or a dot?

So the user can use 1,5 or 1.5 (as we use a comma in our language to seperate the decimal)

Highlighted
Dual Super User III
Dual Super User III

Re: Text input mode - number, blocked decimal comma

Hi @jernejp 

 

You can modify your regex as: 
 
Set(resetvar,false);Set(resetvar,If(IsMatch(TextInput1.Text,"^[1-9]\d*([.,]\d+)?$"),false,true))
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Highlighted
Helper IV
Helper IV

Re: Text input mode - number, blocked decimal comma

Perfect, thank you!

Highlighted
Helper V
Helper V

Re: Text input mode - number, blocked decimal comma

Hi @yashag2255 

I just followed same for textbox property

in my case users will enter like 20,30,50,60, here as per your formula fine 

but the moment when i/users enter outside TextBox means if click any next textbox or control its clearing with blank.

entered Data should be appear untill they enter and submit the form.

your help will be highly appreciated. 

 

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,820)