Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

ASP.NET RegularExpressionValidator

Is there a way to use the RegularExpressionValidator to limit a user to only entering an integer value?

I have tried using \d+ as the expression, but it allows the decimal to be entered.

I know I can use the custom validator, but I want to leverage the ValidatorSummary which only appears to work with non-CustomValidators.

Thanks.

Frustrated
Thursday, January 29, 2004

\d shouldn't allow decimals.
however, are you anchoring your expression? you may just be searching for any string of 1 or more digits within the user's input.
try
^\d+$

mb
Thursday, January 29, 2004

it is a nice way to enable that the user is only able to enter integer value

Ashish Sehra
Wednesday, February 11, 2004

*  Recent Topics

*  Fog Creek Home