Field validation Per Submit buttuns

G

Guest

For simplicity, I have on one form:
-textbox1/Requiere For validation1 / submitbuttun1,

-textbox2/Requiere For validation2 / submitbuttun2,

I have two submit buttons on an ASP.Net page with two textboxes and two
require for validation controls per textbox.

In summary I want to group the fields on the page per submit action, and not
on any action.

My concern is when button on is pressed, then validation1 is fired only,
Without validation2 and vice versa.

In summry I want to

Is that possible, or is there any workaround to obtain this.

help.
 
P

Peter Blum

Microsoft will finally offer the feature of "validation groups" in ASP.NET
2.0. The buttons and validators have a GroupName property. You assign a
common group name to the submit button and the validators it fires. ASP.NET
2.0 will not be out until later this year.

For now, you have these choices:
1. Use server side validation on submit like this:
- Set the CausesValidation property to false each submit button
- In the Click event method, call Validate() on each validator that the
submit button should fire. Then check that all Validators IsValid property
is true before saving.

2. I wrote a replacement to ASP.NET validators that overcomes its numerous
limitations. "Professional Validation And More"
(http://www.peterblum.com/vam/home.aspx) has validation groups, support for
many more browsers on the client-side, 22 validators, and much more. I wrote
it because Microsoft's solution is very simplistic, leaving people asking
for numerous improvements and writing custom code and hacks. My solution
includes a utility to quickly convert you from Microsoft's validators to
mine. It also includes several enhanced textboxes and tools to use
javascript on your web forms without you writing the cross-browser
compatible code.

--- 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

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top