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

customvalidator do not work with empty fields

Hi everyone,

I noticed that customevalidator won't work with empty fields. But I do not
want to put in another requiredfieldvalidator

Any workarounds?

I've tried

if args.Text.trim.length() = 0 then
args.isvalid = false
exit sub
end if

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Mar 27 '07 #1
4 7801
On Mar 27, 9:13 am, "Eric Layman" <namyalcire[at no spam]gmail.com>
wrote:
Hi everyone,

I noticed that customevalidator won't work with empty fields. But I do not
want to put in another requiredfieldvalidator

Any workarounds?
The ValidateEmptyText property, new in ASP.NET 2.0, fixes an issue
with CustomValidator. In ASP.NET 1.0 custom validation would not fire
if the text of the ControlToValidate was empty. You can set this
property to true to cause custom validation to occur for empty input
values.

For .NET 1.0 look at this thread
http://groups.google.com/group/micro...36fdc5dba253cc

Mar 27 '07 #2
if this is javascript code.

if args.Text.trim.length() = 0 then
args.isvalid = false
exit sub
end if
then make sure you properties are correct.

js is case sensitive.

args.IsValid = false
is the correct way I think, but double check my case.

"Eric Layman" <namyalcire[at no spam]gmail.comwrote in message
news:11*************@sp6iad.superfeed.net...
Hi everyone,

I noticed that customevalidator won't work with empty fields. But I do not
want to put in another requiredfieldvalidator

Any workarounds?

I've tried

if args.Text.trim.length() = 0 then
args.isvalid = false
exit sub
end if

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

Mar 27 '07 #3
Howdy,

You have to set ValidateEmptyText property to true

<asp:CustomValidator runat="server" ID="cv" ValidateEmptyText="true"/>
--
Milosz
"Eric Layman" wrote:
Hi everyone,

I noticed that customevalidator won't work with empty fields. But I do not
want to put in another requiredfieldvalidator

Any workarounds?

I've tried

if args.Text.trim.length() = 0 then
args.isvalid = false
exit sub
end if

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Mar 28 '07 #4
I know it might sound stupid but can anyone see my replies? :-)
--
Milosz
"Alexey Smirnov" wrote:
On Mar 27, 9:13 am, "Eric Layman" <namyalcire[at no spam]gmail.com>
wrote:
Hi everyone,

I noticed that customevalidator won't work with empty fields. But I do not
want to put in another requiredfieldvalidator

Any workarounds?

The ValidateEmptyText property, new in ASP.NET 2.0, fixes an issue
with CustomValidator. In ASP.NET 1.0 custom validation would not fire
if the text of the ControlToValidate was empty. You can set this
property to true to cause custom validation to occur for empty input
values.

For .NET 1.0 look at this thread
http://groups.google.com/group/micro...36fdc5dba253cc

Mar 28 '07 #5

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

Similar topics

19
by: David Logan | last post by:
We need an additional function in the String class. We need the ability to suppress empty fields, so that we can more effectively parse. Right now, multiple whitespace characters create multiple...
1
by: Shaggers | last post by:
I need to hide/not display a blank row on a subform. The Main form is based on a table, contains Site Header information The Subform is based on another table containing Sample Details records ...
2
by: Viktor | last post by:
I have a problem with counting empty fields in table. For example: I have the field in which i coulld write several solutions. "done", "not done", "send", "not send" etc. In report i want to...
1
by: naboumerhi | last post by:
Hi, I have a a custom report trying to hide empty fields and shift the next field up. It still shows and empty space. Example: company1 company2 company3
13
by: elsheh | last post by:
Hi.. guys I’m trying to use JavaScript to validate my HTML for empty fields. My code is as below. The problem is that I can escape validation and submit empty fields. Any clue? <html> ...
5
by: Phaelle | last post by:
In my database, some fields are empty for some recordings. And I wouldl like that the empty fields donīt appear on the answer page of my search engine or, in other worlds, that I donīt have that...
15
by: JFKJr | last post by:
Hello everyone, I have imported an excel file into an Access table, but the table contains some empty fields, does anyone know how to delete those empty fields using Access VBA? Thanks in Advance.
5
code green
by: code green | last post by:
How can empty fields be detected. SELECT * FROM products WHERE description IS EMPTYThe field may be NULL or just empty and I suppose even space characters.
3
by: FKlusmann | last post by:
I have inherited a big, messy table with duplicated data and empty fields consisting of Names (business, client, supplier, etc.), Addresses ( physical, mailing, shipping, billing), Orders ( Date,...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.