.NETGURU
validation showing up too early...
Messages   Related Types
This message was discovered on ASPFriends.com 'aspng-validators' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Rachel Reese
-- Moved from [aspngvb] to [aspng-validators] by devin <Click here to reveal e-mail address> --

Hi folks,

I have a form that I've created on one page, with several tables that become
visible and them invisible as the user moves through the form. I have
validation on every field (yeah, they're all required).
The first table displays fine, and the submit and update to the next table
works fine, but as soon as the page refreshes and the second table shows up,
the validation errors are already there as if the user tried to already
continue without filling them in.

Is there a workaround to get them to not show up until the user has actually
tried to submit the second (or nth) table?

Thanks,
Rachel

Reply to this message...
 
    
Steven A Smith (VIP)
I'm pretty sure not. The workaround would be to use different ASPX pages
for each different page of your form. Unfortunately, the validation
controls only understand the context of a single form/page, and so you can't
selectively validate only parts of your ASP.NET page.

Steve

----- Original Message -----
From: "Rachel Reese" <Click here to reveal e-mail address>
To: "aspng-validators" <Click here to reveal e-mail address>
Sent: Friday, April 26, 2002 2:16 PM
Subject: [aspng-validators] validation showing up too early...

> -- Moved from [aspngvb] to [aspng-validators] by devin
<Click here to reveal e-mail address> --
[Original message clipped]

Reply to this message...
 
    
Devin Rader
The way I have done this is to set CausesValidation property of the
offending objects to false, then using the object.Validate() method, check
each objects validation state when I need to.

Kind of clunky and I wish there was a better way to do it. I think they
someone could extend the current controls that have a CausesValidation
property to also have a CausesValidationOn property to specify which
controls to validate.

Devin

-----Original Message-----
From: Steven A Smith [mailto:Click here to reveal e-mail address]
Sent: Friday, April 26, 2002 1:40 PM
To: aspng-validators
Subject: [aspng-validators] Re: validation showing up too early...

I'm pretty sure not. The workaround would be to use different ASPX pages
for each different page of your form. Unfortunately, the validation
controls only understand the context of a single form/page, and so you can't
selectively validate only parts of your ASP.NET page.

Steve

----- Original Message -----
From: "Rachel Reese" <Click here to reveal e-mail address>
To: "aspng-validators" <Click here to reveal e-mail address>
Sent: Friday, April 26, 2002 2:16 PM
Subject: [aspng-validators] validation showing up too early...

> -- Moved from [aspngvb] to [aspng-validators] by devin
<Click here to reveal e-mail address> --
[Original message clipped]

| [aspng-validators] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/aspng-validators.asp = JOIN/QUIT
Reply to this message...
 
    
Carson McComas
Hi Rachel,

I had a similar problem, This is how I got around it:

Once the page had posted and I'd done my logic, instead of just letting
the page load back up, I actually did a Response.Redirect back to the
page (the redirect sort of short-circuted the form posting). That solved
the problem for me. You might need to do some querystring manipulation
or something to indicate movement through your form sequence but this
might be your solution.

Good luck.
Carson

-----Original Message-----
From: Rachel Reese [mailto:Click here to reveal e-mail address]
Sent: Friday, April 26, 2002 11:16 AM
To: aspng-validators
Subject: [aspng-validators] validation showing up too early...

-- Moved from [aspngvb] to [aspng-validators] by devin
<Click here to reveal e-mail address> --

Hi folks,

I have a form that I've created on one page, with several tables that
become
visible and them invisible as the user moves through the form. I have
validation on every field (yeah, they're all required).
The first table displays fine, and the submit and update to the next
table
works fine, but as soon as the page refreshes and the second table shows
up,
the validation errors are already there as if the user tried to already
continue without filling them in.

Is there a workaround to get them to not show up until the user has
actually
tried to submit the second (or nth) table?

Thanks,
Rachel
| [aspng-validators] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/aspng-validators.asp = JOIN/QUIT

Reply to this message...
 
    
Rachel Reese
RE: [aspng-validators] Re: validation showing up too early...Thanks Devin and Carson. Both ways would've worked I think, but I started on Devin's (just because I saw it first). I ended up modifying it a little. I put panels around my tables, set CausesValidation="false" and then forced validation of "everything" on postback with MyBase.Validate() (I'm not sure why, but instead of validating "everything", it only validates the first panel...?). If everything in the first panel was valid, I displayed the next panel, if not I redisplayed the first.

The only problem is that it causes an unsightly reload of every panel except the last for validation. On the last one, the validation is dynamic.

Thanks for all your help.

Rachel.

----- Original Message -----
From: Devin Rader
To: aspng-validators
Sent: Friday, April 26, 2002 2:57 PM
Subject: [aspng-validators] Re: validation showing up too early...

The way I have done this is to set CausesValidation property of the offending objects to false, then using the object.Validate() method, check each objects validation state when I need to.

Kind of clunky and I wish there was a better way to do it. I think they someone could extend the current controls that have a CausesValidation property to also have a CausesValidationOn property to specify which controls to validate.

Devin

-----Original Message-----
From: Steven A Smith [mailto:Click here to reveal e-mail address]
Sent: Friday, April 26, 2002 1:40 PM
To: aspng-validators
Subject: [aspng-validators] Re: validation showing up too early...

I'm pretty sure not. The workaround would be to use different ASPX pages
for each different page of your form. Unfortunately, the validation
controls only understand the context of a single form/page, and so you can't
selectively validate only parts of your ASP.NET page.

Steve

----- Original Message -----
From: "Rachel Reese" <Click here to reveal e-mail address>
To: "aspng-validators" <Click here to reveal e-mail address>
Sent: Friday, April 26, 2002 2:16 PM
Subject: [aspng-validators] validation showing up too early...

> -- Moved from [aspngvb] to [aspng-validators] by devin
<Click here to reveal e-mail address> --
[Original message clipped]

| [aspng-validators] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/aspng-validators.asp = JOIN/QUIT

| [aspng-validators] member Click here to reveal e-mail address = YOUR ID | http://www.aspfriends.com/aspfriends/aspng-validators.asp = JOIN/QUIT
Reply to this message...
 
    
Ronda (VIP)
Rachel,

I just saw this thread but did you try just setting the button to
causesvalidation="false". This works for me when I have registration
forms and several buttons.

Ronda

-----Original Message-----
From: Rachel Reese [mailto:Click here to reveal e-mail address]
Sent: Friday, April 26, 2002 3:14 PM
To: aspng-validators
Subject: [aspng-validators] Re: validation showing up too early...

Thanks Devin and Carson. Both ways would've worked I think, but I
started on Devin's (just because I saw it first). I ended up modifying
it a little. I put panels around my tables, set
CausesValidation="false" and then forced validation of "everything" on
postback with MyBase.Validate() (I'm not sure why, but instead of
validating "everything", it only validates the first panel...?). If
everything in the first panel was valid, I displayed the next panel, if
not I redisplayed the first.

The only problem is that it causes an unsightly reload of every panel
except the last for validation. On the last one, the validation is
dynamic.

Thanks for all your help.

Rachel.

----- Original Message -----
From: Devin <mailto:Click here to reveal e-mail address> Rader
To: aspng-validators <mailto:Click here to reveal e-mail address>
Sent: Friday, April 26, 2002 2:57 PM
Subject: [aspng-validators] Re: validation showing up too early...

The way I have done this is to set CausesValidation property of the
offending objects to false, then using the object.Validate() method,
check each objects validation state when I need to.
Kind of clunky and I wish there was a better way to do it. I think they
someone could extend the current controls that have a CausesValidation
property to also have a CausesValidationOn property to specify which
controls to validate.
Devin

-----Original Message-----
From: Steven A Smith [mailto:Click here to reveal e-mail address]
Sent: Friday, April 26, 2002 1:40 PM
To: aspng-validators
Subject: [aspng-validators] Re: validation showing up too early...

I'm pretty sure not. The workaround would be to use different ASPX
pages
for each different page of your form. Unfortunately, the validation
controls only understand the context of a single form/page, and so you
can't
selectively validate only parts of your ASP.NET page.
Steve
----- Original Message -----
From: "Rachel Reese" <Click here to reveal e-mail address>
To: "aspng-validators" <Click here to reveal e-mail address>
Sent: Friday, April 26, 2002 2:16 PM
Subject: [aspng-validators] validation showing up too early...

> -- Moved from [aspngvb] to [aspng-validators] by devin
<Click here to reveal e-mail address> --
[Original message clipped]

up,
> the validation errors are already there as if the user tried to
already
[Original message clipped]

| [aspng-validators] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/aspng-validators.asp = JOIN/QUIT
| [aspng-validators] member Click here to reveal e-mail address = YOUR ID |
http://www.aspfriends.com/aspfriends/aspng-validators.asp = JOIN/QUIT
| [aspng-validators] member Click here to reveal e-mail address = YOUR ID |
http://www.aspfriends.com/aspfriends/aspng-validators.asp = JOIN/QUIT
Reply to this message...
 
    
Rachel Reese
RE: [aspng-validators] Re: validation showing up too early...Hi Ronda,

Thanks, but if I just set the first button to causesvalidation="false" then it never validates the info in that panel. It just ignores it and then only validates the information that's showing when they hit the final submit button. Not sure why, but to get it to validate previous panels, I need the mybase.validate() on every reload.

thanks,
Rachel
----- Original Message -----
From: Ronda
To: aspng-validators
Sent: Saturday, April 27, 2002 11:05 PM
Subject: [aspng-validators] Re: validation showing up too early...

Rachel,

I just saw this thread but did you try just setting the button to causesvalidation="false". This works for me when I have registration forms and several buttons.

Ronda

-----Original Message-----
From: Rachel Reese [mailto:Click here to reveal e-mail address]
Sent: Friday, April 26, 2002 3:14 PM
To: aspng-validators
Subject: [aspng-validators] Re: validation showing up too early...

Thanks Devin and Carson. Both ways would've worked I think, but I started on Devin's (just because I saw it first). I ended up modifying it a little. I put panels around my tables, set CausesValidation="false" and then forced validation of "everything" on postback with MyBase.Validate() (I'm not sure why, but instead of validating "everything", it only validates the first panel...?). If everything in the first panel was valid, I displayed the next panel, if not I redisplayed the first.

The only problem is that it causes an unsightly reload of every panel except the last for validation. On the last one, the validation is dynamic.

Thanks for all your help.

Rachel.

----- Original Message -----

From: Devin Rader

To: aspng-validators

Sent: Friday, April 26, 2002 2:57 PM

Subject: [aspng-validators] Re: validation showing up too early...

The way I have done this is to set CausesValidation property of the offending objects to false, then using the object.Validate() method, check each objects validation state when I need to.

Kind of clunky and I wish there was a better way to do it. I think they someone could extend the current controls that have a CausesValidation property to also have a CausesValidationOn property to specify which controls to validate.

Devin

-----Original Message-----
From: Steven A Smith [mailto:Click here to reveal e-mail address]
Sent: Friday, April 26, 2002 1:40 PM
To: aspng-validators
Subject: [aspng-validators] Re: validation showing up too early...

I'm pretty sure not. The workaround would be to use different ASPX pages
for each different page of your form. Unfortunately, the validation
controls only understand the context of a single form/page, and so you can't
selectively validate only parts of your ASP.NET page.

Steve

----- Original Message -----
From: "Rachel Reese" <Click here to reveal e-mail address>
To: "aspng-validators" <Click here to reveal e-mail address>
Sent: Friday, April 26, 2002 2:16 PM
Subject: [aspng-validators] validation showing up too early...

> -- Moved from [aspngvb] to [aspng-validators] by devin
<Click here to reveal e-mail address> --
[Original message clipped]

| [aspng-validators] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/aspng-validators.asp = JOIN/QUIT

| [aspng-validators] member Click here to reveal e-mail address = YOUR ID | http://www.aspfriends.com/aspfriends/aspng-validators.asp = JOIN/QUIT

| [aspng-validators] member Click here to reveal e-mail address = YOUR ID | http://www.aspfriends.com/aspfriends/aspng-validators.asp = JOIN/QUIT

| [aspng-validators] member Click here to reveal e-mail address = YOUR ID | http://www.aspfriends.com/aspfriends/aspng-validators.asp = JOIN/QUIT
Reply to this message...
 
 




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification