This message was discovered on ASPFriends.com 'aspngregexp' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
| Rodrigo Tetsuo Aoki |
-- Moved from [aspngfreeforall] to [aspngregexp] by Charles M. Carroll <Click here to reveal e-mail address> --Is it possible to make sure that the value is a number when the user isfilling out a form by using RegularExpressionValidator?I'm trying to use it, but I don't know how to build the rightValidationExpression.Or there's another easier way to do it?Thanks in advanced,Rodrigo Tetsuo AokiWeb MasterATITUDE Comunicação DigitalE-Mail: Click here to reveal e-mail address: 55 11 5181-1255
|
|
| |
| | |
| |
| Wayne King |
Yes, you should be able to use a regex to confirm a value is a number. = However, if need to confirm the value is an integer, it may be cleaner = and simpler to use the CompareValidator or the RangeValidator. Both of = these can do data-type check for integer.
Example: <asp:CompareValidator runat=3Dserver Type=3DInteger = Operator=3DDataTypeCheck />
Or: <asp:RangeValidator runat=3Dserver Type=3DInteger MinimumValue=3D"0" = MaximumValue=3D"1000" />
Using a regex, the pattern \d will match any single digit. You can = match a positive number of arbitrary length with \d+ Example: <asp:RegularExpressionValidator runat=3Dserver = ValidationExpression=3D"\d+" />
-----Original Message----- From: Mark Bruce [mailto:Click here to reveal e-mail address] Sent: Wednesday, January 16, 2002 10:41 AM To: aspngregexp Subject: [aspngregexp] Re: RegularExpressionValidator
some good examples here=20 http://regexlib.com =20 Rodrigo Tetsuo Aoki <Click here to reveal e-mail address> wrote:=20
-- Moved from [aspngfreeforall] to [aspngregexp] by Charles M. Carroll = --
Is it possible to make sure that the value is a number when the user is filling out a form by using RegularExpressionValidator?
I'm trying to use it, but I don't know how to build the right ValidationExpression.
Or there's another easier way to do it?
Thanks in advanced,
Rodrigo Tetsuo Aoki Web Master ATITUDE Comunica=E7=E3o Digital E-Mail: Click here to reveal e-mail address Phone: 55 11 5181-1255
|
|
| |
|
| | |
| | |
|
|
|
|