471,089 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,089 software developers and data experts.

How to validate with two separate "forms" on the page?

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.

Trouble is, if they click the "edit" link button in the grid, nothing
happens as the validator on one of the text boxes in the new entry
section claims that it needs a value. Truth is, it does need a value,
but only when they are adding a new entry.

So how do I stop the validator firing when they click on the "edit"
link? I only want it to fire when they click the button to add a new
entry.

TIA

--
Alan Silver
(anything added below this line is nothing to do with me)
Nov 19 '05 #1
6 1410
One of the drawbacks to validation in 1.x is that all of the
validators fire every time unless you go through and disable the ones
you don't need. So, it takes some bruce force, unfortunately.

There are third party validation controls that are a lot smarter than
the ones in 1.x.

2.0 supports 'validation groups' but that is not a lot of help at this
time!

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 17 Feb 2005 16:05:19 +0000, Alan Silver
<al*********@nospam.thanx> wrote:
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.

Trouble is, if they click the "edit" link button in the grid, nothing
happens as the validator on one of the text boxes in the new entry
section claims that it needs a value. Truth is, it does need a value,
but only when they are adding a new entry.

So how do I stop the validator firing when they click on the "edit"
link? I only want it to fire when they click the button to add a new
entry.

TIA


Nov 19 '05 #2
>One of the drawbacks to validation in 1.x is that all of the
validators fire every time unless you go through and disable the ones
you don't need. So, it takes some bruce force, unfortunately.
How can I do that? When the server sends out the page, it doesn't know
if the user is going to fill in the new entry form, or click the "edit"
linkbutton. The client-side validation fires, preventing the page from
being posted back to the server.

Any suggestions? Thanks for the reply
There are third party validation controls that are a lot smarter than
the ones in 1.x.

2.0 supports 'validation groups' but that is not a lot of help at this
time!

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 17 Feb 2005 16:05:19 +0000, Alan Silver
<al*********@nospam.thanx> wrote:
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.

Trouble is, if they click the "edit" link button in the grid, nothing
happens as the validator on one of the text boxes in the new entry
section claims that it needs a value. Truth is, it does need a value,
but only when they are adding a new entry.

So how do I stop the validator firing when they click on the "edit"
link? I only want it to fire when they click the button to add a new
entry.

TIA


--
Alan Silver
(anything added below this line is nothing to do with me)
Nov 19 '05 #3
On Thu, 17 Feb 2005 21:12:47 +0000, Alan Silver
<al*********@nospam.thanx> wrote:
One of the drawbacks to validation in 1.x is that all of the
validators fire every time unless you go through and disable the ones
you don't need. So, it takes some bruce force, unfortunately.


How can I do that? When the server sends out the page, it doesn't know
if the user is going to fill in the new entry form, or click the "edit"
linkbutton. The client-side validation fires, preventing the page from
being posted back to the server.


Peter Blum's controls are highly recommended:
http://www.peterblum.com/vam/home.aspx

Another solution is to disable client side validation and enable /
disable on the server, along the lines of:
http://www.codeproject.com/aspnet/groupvalidator.asp

HTH,

--
Scott
http://www.OdeToCode.com/blogs/scott/

Nov 19 '05 #4
>>>One of the drawbacks to validation in 1.x is that all of the
validators fire every time unless you go through and disable the ones
you don't need. So, it takes some bruce force, unfortunately.
How can I do that? When the server sends out the page, it doesn't know
if the user is going to fill in the new entry form, or click the "edit"
linkbutton. The client-side validation fires, preventing the page from
being posted back to the server.


Peter Blum's controls are highly recommended:
http://www.peterblum.com/vam/home.aspx


Wow, they look good. Have you used these? I can see that a few of those
would be very useful, but I'd like to know if they are as good as they
look.
Another solution is to disable client side validation and enable /
disable on the server, along the lines of:
http://www.codeproject.com/aspnet/groupvalidator.asp


That's clever!! I'll have a closer look at that as it seems to do what I
want quite simply.

Thanks for the reply.

--
Alan Silver
(anything added below this line is nothing to do with me)
Nov 19 '05 #5
>>Peter Blum's controls are highly recommended:
http://www.peterblum.com/vam/home.aspx


Wow, they look good. Have you used these? I can see that a few of those
would be very useful, but I'd like to know if they are as good as they
look.


Personally I have not - but people I know are very happy with them,
and say not only is the software solid but the support and
documentation are excellent also.

--
Scott
http://www.OdeToCode.com/blogs/scott/
Nov 19 '05 #6
>>>Peter Blum's controls are highly recommended:
http://www.peterblum.com/vam/home.aspx


Wow, they look good. Have you used these? I can see that a few of those
would be very useful, but I'd like to know if they are as good as they
look.


Personally I have not - but people I know are very happy with them,
and say not only is the software solid but the support and
documentation are excellent also.


Thanks. For $50 per set, they seem quite reasonable. Glad to hear people
like them. Maybe I'll download a trial.

--
Alan Silver
(anything added below this line is nothing to do with me)
Nov 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Woody Lemcke | last post: by
4 posts views Thread by Scott Johnson | last post: by
6 posts views Thread by tony | last post: by
1 post views Thread by Troy Bull | last post: by

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.