Skip to main content
Answer

Any way to restrict user to add only 2 digits in NumberEdit control

  • November 18, 2022
  • 3 replies
  • 163 views

param2022
Jr Varsity II
Forum|alt.badge.img

I want max two number in my Custom field. 

Example the value of that field cannot go above 99.

I have set the MinValue and MaxValue like this

[PXDBInt(MinValue = 1, MaxValue = 99)]

 

but ideally i would like to restrict user from entering the third digit. If anyone knows plz answer.
Thanks.

Best answer by Naveen Boga

Hi, @param2022  Yes, we can restrict to adding only 2 digits.

 

Please add the MaxLength=2 for the field in the .aspx page and check. Here is the screenshot for reference.

 

 

3 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • Answer
  • November 18, 2022

Hi, @param2022  Yes, we can restrict to adding only 2 digits.

 

Please add the MaxLength=2 for the field in the .aspx page and check. Here is the screenshot for reference.

 

 


param2022
Jr Varsity II
Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • November 18, 2022

@Naveen Boga this worked Thanks.

 

Can you plz tell where can I get the documentation for the ASPX properties like this it would be very useful for me.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • November 18, 2022

@param2022  Here is the link where we can get knowledge on the each Web Control properties and hope this helps.

 

http://asp.net-informations.com/webcontrols/web-controls.htm