473,466 Members | 1,639 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to validate that at least one text box has input

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

Aug 28 '07 #1
1 1554
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" <Ho*******@gmail.comwrote in message
news:11*********************@l22g2000prc.googlegro 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

Aug 29 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Alexandre | last post by:
Hi again, What's the best I can do to validate fields like date before send my datas. thx
2
by: Dave | last post by:
I have a page which uses JavaScript to create form elements using document.createElement('input'), etc.. Both Firefox and IE have no problem accomplishing this and when the form is submitted all...
1
by: MikeinDC | last post by:
I found some free js that I want to use in a class project. The original HTML used <form name="form1"> and the W3C validator I am required to use fails it. It says there is no attribute"name"....
11
by: TokyoJ | last post by:
I run a small camp in Alaska for kids and my director is asking for a web form. Could someone please have a look and offer some advice on where I'm making mistake(s)? I'm using the RegExp function...
1
by: john.swilting | last post by:
I am not good in Javascript I begin I do not understand why my function does not go I post my code <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">...
5
by: phpCodeHead | last post by:
I am needing to determine how to go about validating that a field in my form contains only a positive integer. I know that this is fairly simple if the form contains only one element to be...
1
by: SkipNRun | last post by:
I am a novice when comes to JavaScript, AJAX. I am working on a form, which will allow users to update their contact information. In order to make the form flexible, I need to use pull down list. ...
1
by: mbarnhizer | last post by:
Hello All, Trying to figure out how to validate a series of questions on an online test. I am thinking that VB or Javascript is the best route, but your input may make a difference. The site i...
5
by: lolodede | last post by:
i would like to make sure user at least one checkbox and if it select otherand need to make sure to write something in text box <?php $name = 0; $cusID=0; $hobbies =0 ; if (isset ($_POST)) {...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.