Form Validation

T

TCORDON

Is there a way to make the form validation highlight the fields where the
errors occur? (change the backcolor of the textboxes)?

And second, perform validation without postback and run some Javascript?

TIA
 
S

S.M. Altaf [MVP]

Hi,

Use a custom validator control. You can write your own routine in javascript for validation and in the process, highlight the fields that you want highlighted.

Keep in mind though, that if you're going to be highlighting server side controls, you'll need their ClientIds, and that you can get from server side code. So, you'll need to write your custom javascript in the server side and plugging in the clientid values as you generate it.

HTH,
Altaf [MVP]




--------------------------------------------------------------------------------
All that glitters has a high refractive index.
www.mendhak.com
Is there a way to make the form validation highlight the fields where the
errors occur? (change the backcolor of the textboxes)?

And second, perform validation without postback and run some Javascript?

TIA
 
P

Peter Blum

Instead of rewriting every validator with a custom validator, consider an
alternative. I wrote a replacement to the ASP.NET validators called
Professional Validation And More (http://www.peterblum.com/vam/home.aspx).
You can set the style sheet of fields that have errors. You can have it set
focus to the fields with the errors. There are several other techniques to
attract the user's attention on its 25 validation controls. My validators
provide client-side validation on many more browsers than the ASP.NET
Validators in ASP.NET 1.x.

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

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

Staff online

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top