0

I have a problem about validation controls. I have a textbox and I want to get amount value from this control. I use RegularExpressionValidator with this regex

^(\d+([\,]\d*)?)|(\d*([\,]\d+))$

and also I add requiredfieldvalidator. It is ok but I need one more control because I set the default text value 0,00 and I don't want to be able to pass with 0,00 it must be >0,00.

What can I do?

RangeValidator is useless in this situation because 0,00-x,xx not acceptable for me. Please help.

4

1 回答 1

0

Something like this should do

^(?!0+(,0+)?$)((\d*,)?\d+)$

If you want only 2 digits after ,, you can do this

^(?!0+(,0+)?$)(\d+(,\d{2})?)$
于 2014-09-15T12:52:48.360 回答