Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 11th, 2008, 07:12 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 205
Thanks: 4
Thanked 0 Times in 0 Posts
Default [Resolved] Use of Required Field Validators

I have a web application that has a link button to a "contact page" where email can be filled in and submitted using a send button. I am using FiledRequiredValiddators to check that email subject, body etc are filled in. When I am into the contact page and I click the contact link button again, the RequiredFieldValidators show errors. I only want the fields to be validated when I click the "send" button. Thank you.
 
Old March 11th, 2008, 07:15 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Hi there.. The button has a property validateonclick (or something like that) that causes that the form validates or not when you click on it...

Also, you can group the controls that want to be validated with a tag (don't remember the name of the property) so when you click a button that has the same "tag" only the control with that "tag" will be validated...

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old March 11th, 2008, 07:32 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

The propeties Gonzalo is referring to are: CausesValidation and ValidationGroup. The best way to achieve the functionality you would want would be to assign all of your validatiors and your send button to a validation group that way they will only be triggered when the send button is pressed.

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor / Author :.
Wrox Books 24 x 7
================================================== =========
 
Old March 11th, 2008, 07:57 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Thanks Doug!

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old March 11th, 2008, 08:01 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

No Problem. =]

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor / Author :.
Wrox Books 24 x 7
================================================== =========
 
Old March 11th, 2008, 09:53 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 205
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Great, it worked like a champ (using validationgroup)... thank you all, you made my day and I learning something ... hurrahhh






Similar Threads
Thread Thread Starter Forum Replies Last Post
Resolved! - Verify Required fields and email form dartcoach HTML Code Clinic 25 April 28th, 2008 12:48 PM
Enabling and disabling Required field Validators mrufus General .NET 0 June 27th, 2006 03:44 AM
Required field dependent on another field... nkrukovsky Access VBA 3 January 14th, 2004 10:37 AM
required field valuator melvik ASP.NET 1.0 and 1.1 Professional 2 August 24th, 2003 05:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.