Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to validate that at least one text box has input

Reply
Thread Tools

How to validate that at least one text box has input

 
 
Homer
Guest
Posts: n/a
 
      08-28-2007
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

 
Reply With Quote
 
 
 
 
Sherif Elmetainy
Guest
Posts: n/a
 
      08-28-2007
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.

"Homer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> 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
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
problem in running a basic code in python 3.3.0 that includes HTML file Satabdi Mukherjee Python 1 04-04-2013 07:48 PM
Validate that at least one checkbox is checked Zvonko Biškup Javascript 2 03-13-2007 07:03 AM
Width of text input box vs. password input box cjl HTML 1 10-31-2005 11:46 AM
Off Topic: Width of text input box vs. password input box cjl Javascript 7 10-30-2005 10:11 PM



Advertisments