validator limitations

R

Roman

Hi,

I am relatively new to dotnet and have heard great things about form
validation and how easy it is. While I can see some improvements compared
with classic asp I am a bit disappointed at how inflexible it seems.

The requirement I have is that when form fields contain invalid data, ie not
filled in, incorrect date etc, the background color of the form field must
be set to red until the data is valid. After playing around with the
validators I saw this was a little bit more difficult than I thought. I
thought the best way to go was to use the customvalidator and write my own
server-side and client-side functions. the problem I see is that I need to
write just as much code as I needed before (with classic asp) and code reuse
becomes a problem.

When I am implementing my javascript I have to use a function in the format:
function myvalidator{source, arguments}. I can set the background color of
the textbox within this function but how do I create a generic function that
accepts the textbox as an argument so it can be reused on every page without
writing this function for each field that needs to be validated?

Any advice would be appreciated.
 
P

Paul Glavich [MVP ASP.NET]

We have done this in a current project, however we did a number of things
different. We used my DOMValidators (
http://aspalliance.com/glav/downloads/domvalidators.zip ) that have client
side validation support for netscape, mozilla etc (any dom compliant
browser) and this comes with full source code and obviously the javascript
support file for all the client side functions. Since this is typically
included with EACH web application, we modified the javascript support file
(DOMValidation.js) to be able to highlight the background colour of the
field to our clients requirements. The DOMValidators code is free to use and
modify but I cannot share the specific code with you as the clients legal
requirements prevent me from doing so.

- Paul Glavich
 
P

Peter Blum

Hello,

I wrote a replacement to Microsoft's validators due to the extensive
limitations the original has. Like Paul Glavich's "DOMValidators", my
"Professional Validation And More" (http://www.peterblum.com/vam/home.aspx)
supports client-side validation on many more browsers (IE, IE/Mac, Netscape
7, Mozilla, FireFox, Opera 7, and Safari). That's only one of its
advantages. I designed it to be feature rich enough that you have far less
need to write custom code. For example, it has 22 validators. It supports
setting the background color of the field with the error along with many
other techniques to attract the user's attention.

I put together a list of all the limitations in Microsoft's validators that
I've found here: http://www.peterblum.com/vam/valmain.aspx. They are all
addressed in my solution.

--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
 
R

Roman

Thanks Peter. I showed your link to my boss who didn't believe me when I
told him how inflexible the inbuilt validators are.....I am still waiting
for a reply :)
 
P

Paul Glavich [MVP ASP.NET]

Even though I have authored the DOMValidators, they are nowhere near as
feature rich as Peter Blums validator controls, which I highly recommend.
The DOMValidators do the job for the most part, but again, aren't of the
quality of Peter Blums controls. (Thats part of the reason why they are free
;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top