Validation fields

Hi All,

I have 4 textboxes (A, B, C and D) and a radiobuttonlist called R

Since all fields are required, I need to place a Validator, but I dont want to put one per field. Is it possible to group all validations into one validation that say "All Fields are Required" in case an of the controls is empty?

Who is Participating?
You can use validationgroup.

Try this link

pvg1975Author Commented:
Hi, thanks, I saw the example, but I dont see how can I apply it for my code.
I know you don't want to put 1 validator per control but that would be the easiest way to accomplish your stated goal.

1 validator per control then put validationgroup on each control and validator as well as whatever controls cause the postback.

Otherwise you need to use customvalidation for which there is a customvalidator control (or you can just write it yourself), but you need to understand JS if you want it client-side then write the server-side if you want it to be comprehensive validation.

As I said, easiest for you is to follow rajvja's advice.

Here's a different tutorial:

If you want more precise help it would be good to post a simplified version of your code.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.