473,320 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Regular Expression Validator and RequiredFieldValidator ???

I have the following problem.
I am using the follwing Regular Expression validator(REV) with validator expressions
^[0-9]{1,2}$
^[a-zA-Z0-9]{3,20}$
The idea of the first exp is 1 or 2 digits
the idea of second expression is username between 3 and 20 chars

When the user enters characters other than the specified REVs are working.
But if the user leaves the textbox without entering anything
Page.IsValid is true which indicates it is not performng any validation.

I read that {n,m} syntax in .net regular expressions is min(n)-max(m)
in the documentation.

Should i also use ReguiredFieldValidator
in addition to regular expression validator

any one facing the same problem.

where is the mistake in me or in .net
Nov 18 '05 #1
2 5554
Hi, S.Kartikeyan,

Yes, you should use a combination of RegularExpressionValidatior and a
RequiredFieldValidator in order to prevent the user from leaving the
associated control blank.

It is mentioned in the Note in the Remarks section:

http://msdn.microsoft.com/library/en...ClassTopic.asp

Greetings
Martin
"S.Kartikeyan" <in*******@yahoo.com> wrote in message
news:6d**************************@posting.google.c om...
I have the following problem.
I am using the follwing Regular Expression validator(REV) with validator expressions ^[0-9]{1,2}$
^[a-zA-Z0-9]{3,20}$
The idea of the first exp is 1 or 2 digits
the idea of second expression is username between 3 and 20 chars

When the user enters characters other than the specified REVs are working.
But if the user leaves the textbox without entering anything
Page.IsValid is true which indicates it is not performng any validation.

I read that {n,m} syntax in .net regular expressions is min(n)-max(m)
in the documentation.

Should i also use ReguiredFieldValidator
in addition to regular expression validator

any one facing the same problem.

where is the mistake in me or in .net

Nov 18 '05 #2
Thanks For your help.
I was wondering where is the mistake.
Microsoft should have designed it the otherway which is more intuitive.

S.Kartikeyan

"Martin Dechev" <de*******@hotmail.com> wrote in message news:<Oc**************@TK2MSFTNGP12.phx.gbl>...
Hi, S.Kartikeyan,

Yes, you should use a combination of RegularExpressionValidatior and a
RequiredFieldValidator in order to prevent the user from leaving the
associated control blank.

It is mentioned in the Note in the Remarks section:

http://msdn.microsoft.com/library/en...ClassTopic.asp

Greetings
Martin
"S.Kartikeyan" <in*******@yahoo.com> wrote in message
news:6d**************************@posting.google.c om...
I have the following problem.
I am using the follwing Regular Expression validator(REV) with validator

expressions
^[0-9]{1,2}$
^[a-zA-Z0-9]{3,20}$
The idea of the first exp is 1 or 2 digits
the idea of second expression is username between 3 and 20 chars

When the user enters characters other than the specified REVs are working.
But if the user leaves the textbox without entering anything
Page.IsValid is true which indicates it is not performng any validation.

I read that {n,m} syntax in .net regular expressions is min(n)-max(m)
in the documentation.

Should i also use ReguiredFieldValidator
in addition to regular expression validator

any one facing the same problem.

where is the mistake in me or in .net

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: VSK | last post by:
Hi all, I have a .ascx file with dropdownbox (SSN, EmpName) textbox submit button regular expression validator( controltovalidate is the above textbox) Now i want to change the Regular...
2
by: Nazir | last post by:
Hi I'm using a regular expression validator, but if spaces are entered, it bypasses the validation! I'm using ^{5,100}$
2
by: Dot net work | last post by:
Hello. Say I have a .net textbox that uses a .net regularexpressionvalidator. If the regular expression fails, is it possible to launch a small client side javascript function to do something,...
4
by: Daniel | last post by:
I would like to get some help on regular expression to validate decimal numbers. It should also match negative value, empty value. The expression:...
2
by: Scott Natwick | last post by:
Can anyone suggest a good reference for Regular Expressions? Or more specifically, I need to check that a user has made a selection from Drop Down List. The default in my Drop Down List is "". ...
5
by: John . | last post by:
I am using the Regular Expression Validator control to validate a correct email address. But, at the same time I would like to make it a required field. I tested by using just the regular...
2
by: kieran | last post by:
Hi, I am using Visual Studio 2005 and am trying to use a Regular Expression Validator control. I have a drop down list which contains various names, the first one is "Please Select". I want...
3
by: CK | last post by:
Hello All, I have a page with a text box. It has a required field validator, and a regualur expression validator tied to it. A valid email is required. When clientside is enabled it works...
6
by: David | last post by:
I'm having trouble getting the regular expression validator to work with a text box. In this simple example I only want lower case letters to be allowed. So I tried the following and it doesn't...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.