473,320 Members | 2,094 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.

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 7792
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,...
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...
0
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...
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...
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)...
1
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.