473,386 Members | 1,799 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,386 software developers and data experts.

RegularExpressionValidator - check for empty field

Hi all,

I want to use RegularExpressionValidator to enforce non-empty integer format
in a TextBox. However, the validator doesn't give the error when the textbox
is empty. For example, if ValidationExpression is \d+ or even \d{1,}, the
validator still allows empty field. Must I use an additional
RequiredFieldValidator?

-Oleg.
Nov 17 '05 #1
1 5520
If a field is empty every validator (except RequiredFieldValidator) will not
be called.

If a field is required AND has an expected format, you will have to include
2 validators.

Or you can look at writing your own composite control that has both
validators inside it.

bill
"Oleg Ogurok" <oo*****@thecramgroup.ihatespammers.ireallydo.co m> wrote in
message news:vf************@corp.supernews.com...
Hi all,

I want to use RegularExpressionValidator to enforce non-empty integer format in a TextBox. However, the validator doesn't give the error when the textbox is empty. For example, if ValidationExpression is \d+ or even \d{1,}, the
validator still allows empty field. Must I use an additional
RequiredFieldValidator?

-Oleg.

Nov 17 '05 #2

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

Similar topics

3
by: DC | last post by:
I have this snippet: <tr> <td align="left">E-mail</td> <td> <asp:TextBox id="txtEmail" runat="server" MaxLength="100"></asp:TextBox>&nbsp; <asp:RegularExpressionValidator id="revEmail"...
0
by: Shan Plourde | last post by:
Hi everyone, I have been using various regular expressions with the ASP.NET RegularExpressionValidator for quite some time. In general it works very well. One of the common regex's that I use...
3
by: Andy Fish | last post by:
Hi, I have a RegularExpressionValidator with the following regexp ^{0,3}$ It mostly works, but allows a value consisting only of spaces to pass right through. Leading and trailing spaces...
2
by: Neil Zanella | last post by:
Hello, It seems to me that the ASP.NET RegularExpressionValidator ASP.NET control only works whenever the input field is not empty, which means that in most practical scenarios this will have to...
3
by: tshad | last post by:
I have a RegularExpressionValidator that doesn't seem to work correctly if you don't enter anything. In the following, it works correctly if you have at least 1 character. If you just enter...
4
by: =?Utf-8?B?Y3VyaW91cw==?= | last post by:
I am using a RegularExpressionValidator to validate a TextBox. I use "^?+(\.*)?$" to check for a real number. The control works fine as long as the user enters something in the TextBox; it does not...
9
by: Nathan Sokalski | last post by:
I have several TextBoxes with TextMode="MultiLine" in which I want to limit the number of characters that can be entered using a RegularExpressionValidator. I have come up with the following...
16
by: mtuller | last post by:
I am creating a page for nomination and want to let the information pass if any field are filled out, but if none are filled out, a message will appear. I can't get the check to happen on multiple...
3
by: M. Ali Qureshi | last post by:
Hi, I have a text field, where i want the user to add only numbers. The minimum value should be 1 and there is no limit on maximum value. I cannot use RangeValidator, because it requires a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.