bmorgan
Scholar

Min / Max validation for number/decimal input

I need to validate a decimal input. I'm wondering how I can use view validation to require and ensure the value is > 12. How do I do this? This seems like an basic, foundational capability, but I don't see how to do it. I can write a rule or expression, but that seems combersome for such a thing.

 

Does anyone have any suggestions?

0 Kudos
4 Replies
ElvisJacob
Apprentice

Re: Min / Max validation for number/decimal input

Hi Bmorgan


 


See the solution below:


Step1:


Design a textbox and a button on item view


8200i18A3B4EFD742BC17.png


Step2:


Click the button to be highlighted and go to rules


8199i213E90C2D649211F.png


 


Step3:


By clicking an advanced condition the following will appear


8201i809D62FA39A49F3F.png


 


 


Step4:


Click Configure rule on show message to the user


8202i299DAB257E78837B.png


 


Step 5:


Run the program and enter a number less than 20 e.g 10


8203i2CCB88BEA7DC411A.png


 


Additionally, if you would like this validation to prevent the form from submitting until number greater than 20 is entered, you can add a "Stop rule execution rule" under the advanced condition.


 


I hope this will help you!!!


 


Regards


Elvis


 


 

0 Kudos
JeanSmit1
Apprentice

Re: Min / Max validation for number/decimal input

Hi bmorgan,


 


The best way would probably be to use Regex expressions. On an input box there is an option for "Pattern", the tricky part (if you are unfirmiliar with Regex) would be to find a Regex Pattern that suits your needs.


This site might help: http://www.regexlib.com


 


For a quick test it seems that this pattern might help:


/[2-9][0-9]|1[2-9]|11[0-9]/g


 


-Jean


 

0 Kudos
bmorgan
Scholar

Re: Min / Max validation for number/decimal input

Thank you. This may be the only/best route, I was just hoping for a way that wouldn't result in a rule soup on my view. It's going to be a lot of effort (considering all the fields that this will affect on this view) for something that's so simple.

ElvisJacob
Apprentice

Re: Min / Max validation for number/decimal input

Hi Bmorgan 


 


I think another way of doing this is by using regex , see the screenshot below:


Step1: Desing a textbox


8207i200FE018C65BB554.png


Step2: Click on textbox to be highlighted>click pattern on the righthand side>Add Pattern.


8208iBFFABCFA076B4FCF.png


 


Step3:


8209i674DFF98B0856F06.png


Number more than 12 it does not show error message e.g.


8210i8CEE46520E086768.png


 


 


Regards


Elvis

0 Kudos