473,799 Members | 3,132 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can one validation control work for multiple textboxes?

I have a huge form with 91 controls on it and about 1/3 of them are date
fields. Is it possible to use just one compare validator to make sure dates
are being entered or do I have to make one for each text box?

Also can someone think of a easy way to make it so all of these date text
boxes will convert a date entered like this 120203 to 12/02/2003?
Nov 18 '05 #1
3 1980
The validation controls were designed to work with only one control each.
You can extend this model if the standard controls don't meet your
requirements.
Here is some information you might find useful:
http://msdn.microsoft.com/library/de...mmatically.asp

http://msdn.microsoft.com/library/de...ionresults.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Russ" <ru**@NOSPAMaco rdiamn.com> wrote in message
news:uJ******** *****@TK2MSFTNG P11.phx.gbl...
I have a huge form with 91 controls on it and about 1/3 of them are date
fields. Is it possible to use just one compare validator to make sure dates are being entered or do I have to make one for each text box?

Also can someone think of a easy way to make it so all of these date text
boxes will convert a date entered like this 120203 to 12/02/2003?

Nov 18 '05 #2
I tried:

txtbox.Text = txtbox.Text.ToS tring("##/##/##");

It would not compile saying that their were invalid arguments.
"Russ" <ru**@NOSPAMaco rdiamn.com> wrote in message
news:uJ******** *****@TK2MSFTNG P11.phx.gbl...
I have a huge form with 91 controls on it and about 1/3 of them are date
fields. Is it possible to use just one compare validator to make sure dates are being entered or do I have to make one for each text box?

Also can someone think of a easy way to make it so all of these date text
boxes will convert a date entered like this 120203 to 12/02/2003?

Nov 18 '05 #3
Joe
Have you considered using dropdown lists instead of textboxes? This gives
you control of the formatting.

Joe

"Russ" <ru**@NOSPAMaco rdiamn.com> wrote in message
news:eD******** ******@TK2MSFTN GP10.phx.gbl...
I tried:

txtbox.Text = txtbox.Text.ToS tring("##/##/##");

It would not compile saying that their were invalid arguments.
"Russ" <ru**@NOSPAMaco rdiamn.com> wrote in message
news:uJ******** *****@TK2MSFTNG P11.phx.gbl...
I have a huge form with 91 controls on it and about 1/3 of them are date
fields. Is it possible to use just one compare validator to make sure

dates
are being entered or do I have to make one for each text box?

Also can someone think of a easy way to make it so all of these date text boxes will convert a date entered like this 120203 to 12/02/2003?


Nov 18 '05 #4

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

Similar topics

0
379
by: DBQueen | last post by:
I am developing an application for a Pathology Lab. There are Batches (BatchID) which contain multiple Samples (SampleID), and there can be multiple tests run from the same Sample, thus there can be multiple records with the same SampleID. The Basic Data for the samples is entered when the batch is set up initially. There are also 3 results textboxes which will hold the results of the Pathology tests. If the user realizes that there is...
4
2677
by: Kathy | last post by:
I have a form to generate a report. On the form are several textboxes and a "Generate" button. I would like to have the button grayed (not enabled), unless the data in each of the dependant textboxes is valid. What is the proper procedure for doing this? It seems the Validating and Validated events for each control only fire when it loses focus. I would like the button to be enabled as soon as the data is valid (before leaving the...
4
4504
by: earwicker | last post by:
I recently deployed a web application which contains a user registration form with the usual fields: name, address, email, password, etc. Each of the TextBoxes uses a validation control to verify the input. On my development server, this form works precisely as expected. When I deploy the app to the production server (a hosting service), the client-side validation quits working altogether. Now, I KNOW that scripts are enabled and working...
7
2876
by: A.M | last post by:
Hi, I have a validation control in my page that upon any invalid data, it disables all buttons in the page. basicly i don't have any postback in the page if the validator finds any error. How can have the validator just disable certain control's postback and other part of page continue their functionality. Thanks,
4
9698
by: Mad Scientist Jr | last post by:
i am trying to set focus to a specific control depending on the outcome of a validator control and it is not working. none of these methods are working to setfocus: 1. RegisterStartupScript("sf","<scriptlanguage='javascript'>document.form.MyControlID.focus();</script>"); 2. Andy Smith's FirstFocus control from http://www.metabuilders.com/tools/FirstFocus.aspx
1
1965
by: Kum | last post by:
Hi, I need help in asp.net dynamic textbox controls validation. I am creating textbox controls dynamically on a asp.net webpage. Now after creating the textboxes on the page I want to validate these text boxes when the user submits or posts back to the server. My intention was to create a textboxvalidator function which takes the control name as argument and returns an true if
5
2822
by: Richard Brown | last post by:
Ok, I've been looking through the .NET SDK docs and stuff. I'm wondering if you can provide a control extender that does generic validation or functionality just by dropping it on the form. For instance, using the IExtenderProvider interface, you can specify properties, but there is nothing documented about linking into a control's events. For instance, in my application, there are specific formatting, functionality and validation for...
12
1351
by: NuB | last post by:
The validation controls are giving me a headache. here is what i'm trying to do and so far what I've tried has not worked. I need to hide my grid if the page is not valid how can i accomplish that? I have one validation control that gives an error if there is no data returned, so if the page is not valid on another search i need that to go away. How can i hide and show controls and labels bases on the page.isvalid
12
2050
by: Dabbler | last post by:
I need to insure that at least one of three phone number fields has a value (requiredfield) but I'm not sure of a way to implement this without server side logic. Is there a way to use the validation controls to do this? Thanks.
0
9685
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
9538
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,...
0
10247
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10214
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
10023
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
9067
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...
0
6803
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3751
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2935
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.