Good afternoon,
I need help to solve the following problem:
I need to restrict a range of values to a textbox.
I have already the minimum and maximum value allowed in the textbox, but is missing me intermediate values.
An example:
From the minimum value -2,00 to maximum value 0,00 it accepts: -2,00 | -1,75 | -1,50 | -1,25 | -1,00 | -0,75 | -0,5 | -0,25 | 0,00
From the minimum value 0,00 to maximum value 1,00 it accepts: 0,00 | 0,25 | 0,50 | 0,75 | 1,00
and so on..
What will be the best way to do that?
Thank you.
You could use a CustomValidator and write your own validation method to check if the value is a multiple of 0.25. You can add this to the page:
And then add something like this to the code behind: