473,659 Members | 2,646 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to validate one control based on the truth value of another validator?

Suppose that I have the following on my web:

Your annual income:
o > o < ___________
If the user enters a number in the textbox indicated by the underline,
but forget to click either of the two radio buttons for ">" and "<", I
want to warn the user that if he does supply a (valid) number for the
annual income information, he must check one radio button.

How do I do this? It looks like that I have to check the truth value
of the TextBox validator inside the RadioButtonList validator.

Could any of you share your experience with me? Thanks.

If you think that this idea can be implemented in a better way, please
educate. Thanks.

Nov 19 '05 #1
1 1212
Custom Validator on the textbox. Check it's value and then check the two
radio's. It's a manual process but it's what you'll probably have to do.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"an***********@ yahoo.com" wrote:
Suppose that I have the following on my web:

Your annual income:
o > o < ___________
If the user enters a number in the textbox indicated by the underline,
but forget to click either of the two radio buttons for ">" and "<", I
want to warn the user that if he does supply a (valid) number for the
annual income information, he must check one radio button.

How do I do this? It looks like that I have to check the truth value
of the TextBox validator inside the RadioButtonList validator.

Could any of you share your experience with me? Thanks.

If you think that this idea can be implemented in a better way, please
educate. Thanks.

Nov 19 '05 #2

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

Similar topics

5
2624
by: Jeff Evans | last post by:
I have a custom composite control which has a validator for a textbox. The validator and textbox are declared in the class and created in the CreateChildControls() method Here is the code for the textbox, in CreateChildControls() searchBox = new TextBox(); searchBox.ID = "searchBox"; searchBox.EnableViewState = false; It is then added to a TableCell, which is added to a row, etc.
4
4278
by: Wysiwyg | last post by:
I need to validate a form to ensure that all of the fields add up correctly. I can't do this while the user is entering data since validation needs to be done after the entry is completed. What's the "best" way to validate prior to submitting? I could add an onsubmit attribute to the form which executes the validation in Javascript. That way the response doesn't need to be sent before validation takes place. Is this pretty much the way...
6
1520
by: Alan Silver | last post by:
Hello, I have a page that displays a data list with info from a database. The grid has the usual stuff, edit, update, delete etc. Below this I have a section where they can add a new entry to the list. This has some text boxes for the data, and a button to click when they are ready to submit. To the user, this looks like two separate forms, one containing a grid of existing data and one where they add new data.
3
5953
by: Martin | last post by:
Hi, I am implemeting a form in asp.net. The form is quite large and the validation is reasonably complex, so I have decieded to implement my own validation rather than use any custon validators, so I have a button on the form and the "causes validation" property is set to true. I have overridden the "Validate()" like so
1
1816
by: Joey | last post by:
Does anyone know how to validate only one certain control in server side code on postback? Instead of Page.Validate() and Page.IsValid, is there some functionality equivalent to txtMyTextBox.IsValid... I could also make it work if I could figure out how to use server side code to compare a string value against a regular expression string, with a boolean true/false result. I need to do this to ensure that my database insert does not...
2
1167
by: David C | last post by:
I have a DropDownList control that has a value of 0 for not selected and a -1 for adding a new company. I want to be able to validate to say that this selected value is not 0 or -1 but I couldn't find a control validator that did this. Can someone help? Thanks. p.s. I am using .Net 2.0 and VS2005. David
0
8222
drhowarddrfine
by: drhowarddrfine | last post by:
Many people think of validation as a mark of valor so they can put on their web page the little W3C logo proclaiming they have achieved some poetic, high moral platform. In truth, validation is error checking. Validation means your markup contains the proper syntax that browsers will understand and should render properly. Some people think that just because their code displays properly in their browser there is no need to validate or...
4
2590
by: Brybot | last post by:
I have a form that i've split up into multiple asp:panels, each panel has a number of validators which work correctly. At on the last panel, i want to commit the data collected to a database. I figured since all the panel data is still being sent through the postbacks, instead of using Sessions, or HttpContext, I could just take the values from the textboxes. This all works fine, except for security. I realized that I could inject...
5
1868
by: Ganesh | last post by:
Hi There, I need to validate email address with regular expression control, i tried something like this ^+*@*\.*$ but i need to validate even if it is blank, it should say invalid email, but don't want to use another requirefield validator
0
8428
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8339
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8535
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8629
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7360
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4176
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4338
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.