|
-
Oct 19th, 2004, 10:26 PM
#1
RequiredFieldValidator [Resolved]
Is it possible to have a RequiredFieldValidator monitor more
than one control? I want to validate a textbox and a calendar
control with one validator. Or is there another way to do this
other than having a single validator for each control?
Thanks.
Last edited by RobDog888; Oct 22nd, 2004 at 06:37 PM.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 20th, 2004, 05:51 PM
#2
Banned
Re: RequiredFieldValidator
Originally posted by RobDog888
Is it possible to have a RequiredFieldValidator monitor more
than one control? I want to validate a textbox and a calendar
control with one validator. Or is there another way to do this
other than having a single validator for each control?
Thanks.
Robb I think you'd have to change it via code dynamically.
Me.RequiredFieldValidator.ControlToValidate
-
Oct 20th, 2004, 06:03 PM
#3
Yes, Jon I saw that possibility. But if it gets changed through
code then the validator will stop monitoring the previous control
and change to only the new one. So if I have 5 textboxes I want
to validate upon a single button press then I would have to write
more code than if I just created a validator for each. Guess I will
just have to settle for one validator per control. Just more to
manage thats all. Unless you can think of another way?
Thanks Jon.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 20th, 2004, 09:35 PM
#4
Banned
Originally posted by RobDog888
Yes, Jon I saw that possibility. But if it gets changed through
code then the validator will stop monitoring the previous control
and change to only the new one. So if I have 5 textboxes I want
to validate upon a single button press then I would have to write
more code than if I just created a validator for each. Guess I will
just have to settle for one validator per control. Just more to
manage thats all. Unless you can think of another way?
Thanks Jon.
No you dont have to do it like this at all. All you need is a validation summary. I use validation summaries on like register pages where I need to validate more than one control.
A validation summary takes all the controls into one single message or label and displays the message yyou want.
Look it up or I can post an example.
Jon
-
Oct 20th, 2004, 10:17 PM
#5
Ok, I will look it up and if I still have problems I'll be back.
Thanks for your help Jon!
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 20th, 2004, 11:00 PM
#6
PowerPoster
One validator per control....unless you inherit from the basevalidator class (don't know the exact name right now) and add the custom code to it.
The problem is that you won't be able to flag which control caused the problem to the user.
Better stick with one validator per control.
-
Oct 20th, 2004, 11:28 PM
#7
Ok, I found it and tried it out on two requiredfieldvalidators
and it appears to be a summary of all the rfvs per page. Is it just
to summarize rfvs or ???
Thanks.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 21st, 2004, 07:55 AM
#8
Banned
Originally posted by RobDog888
Ok, I found it and tried it out on two requiredfieldvalidators
and it appears to be a summary of all the rfvs per page. Is it just
to summarize rfvs or ???
Thanks.
Morning Rob,
Yes .
I think you will need a rfv for each field, and you can summarize using the validation summary.
-
Oct 21st, 2004, 10:21 AM
#9
I got it working fine now for my page, but I have a Calendar control
on it and it needs to be validated too. There is no Calendar items
in the dropdown list for controls to validate and if I assign it in
code it gives a error. How can I, other than code for a #12:00:00
AM# date, validate the calendar?
Thanks again.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 21st, 2004, 01:19 PM
#10
Banned
Originally posted by RobDog888
I got it working fine now for my page, but I have a Calendar control
on it and it needs to be validated too. There is no Calendar items
in the dropdown list for controls to validate and if I assign it in
code it gives a error. How can I, other than code for a #12:00:00
AM# date, validate the calendar?
Thanks again.
Hi Rob,
Click on this control look for "Causes Validation" as a property.
Set it to yes..if you see it!
-
Oct 21st, 2004, 01:28 PM
#11
Ok, I will look for it when I get home.
Thanks.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 21st, 2004, 11:46 PM
#12
Jon, I looked and I know I'm not blind but I dont see it. I am using
the standard Calendar control from the toolbox.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 22nd, 2004, 07:30 AM
#13
Banned
Originally posted by RobDog888
Jon, I looked and I know I'm not blind but I dont see it. I am using
the standard Calendar control from the toolbox.
I dont think it has one, you will have to code it...
check if its null or what not, btw usually what I do is use a text box with a button next to it. If you click the button a calendar opens. That way you can place a required field validatar against the text box.
Jon
-
Oct 22nd, 2004, 10:19 AM
#14
Banned
For anyone else:
Microsoft has a nice page dealing with validation in general.
Great stuff:
http://msdn.microsoft.com/library/de...erControls.asp
-
Oct 22nd, 2004, 06:37 PM
#15
Thanks, Jon. That link will help me to understand the other types
of validation.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|