How to validate that at least one text box has input

H

Homer

Hi,

I've created a page that allows employee to change their personnel
information, like name, marital status, address, etc. When the user
clicks the Send button to send the change requests via email to HR, I
want to make sure that at least one of the text boxes has input. For
example, a user may only want HR to change his marital status and
nothing else. In this case, validation should pass and an email is
sent. However, if nothing is entered and the user clicks send, the
send operation should not be executed and the user should be alerted
that at least one change must be inputted before clicking send. I
cannot use a validator control before if one control does not have
input, the Page.IsValid would be set to False. Is there a way to do
this?

Thanks,
Jon
 
S

Sherif Elmetainy

You can use a CustomValidator. The client and server side validation
functions should compare the new values with orignal value and set
args.IsValid to true is at least one value is changed.
 

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

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top