We have a need to ensure that users do not click multiple times on any
buttons that will submit the page. We have placed an onclick method on
all of them that counts how many times a submit like button has been
pressed, and if more than once, then there is an alert to the user, and
the subsequent submits are not processed.

Now here comes the interesting part...

We also have a few .NET validators on the page. If any of these
validators get tripped, and then the user tries to submit the page with
errors, and then corrects the problem, our handy dandy little onclick
will not let us continue because they have now pressed the button
twice. I was wondering if there is any way to tell from our
Javascript if the page is valid...

I attempted to call the Page_ClientValidate() method from our method,
and then check the Page_IsValid variable, which are in the
WebUIValidation.js file, but this didn't work.

Any help would be greatly appreciated!

Thanks!

Re: .NET Validators Combined with Javascript by Alvin

Alvin
Wed Feb 16 19:20:07 CST 2005

the usual approach to preventing multi-submits is to simply disable the
button on the click event client-side. Why haven't you simplified your
routine to this?

--
Regards,
Alvin Bruney [Microsoft MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ http://www.lulu.com/owc
----------------------------------------------------------


<quiggle@u.washington.edu> wrote in message
news:1108599665.791699.178080@l41g2000cwc.googlegroups.com...
> We have a need to ensure that users do not click multiple times on any
> buttons that will submit the page. We have placed an onclick method on
> all of them that counts how many times a submit like button has been
> pressed, and if more than once, then there is an alert to the user, and
> the subsequent submits are not processed.
>
> Now here comes the interesting part...
>
> We also have a few .NET validators on the page. If any of these
> validators get tripped, and then the user tries to submit the page with
> errors, and then corrects the problem, our handy dandy little onclick
> will not let us continue because they have now pressed the button
> twice. I was wondering if there is any way to tell from our
> Javascript if the page is valid...
>
> I attempted to call the Page_ClientValidate() method from our method,
> and then check the Page_IsValid variable, which are in the
> WebUIValidation.js file, but this didn't work.
>
> Any help would be greatly appreciated!
>
> Thanks!
>



Re: .NET Validators Combined with Javascript by quiggle

quiggle
Wed Feb 16 19:40:08 CST 2005

If we were to disable the button after they pressed it, and there
happen to be a validation error, then after the user fixed the problem,
the button would still be disabled, and they would not be able to
proceed.


Re: .NET Validators Combined with Javascript by Alvin

Alvin
Wed Feb 16 22:15:57 CST 2005

but you realize this is the exceptional case that can be easily remedied
right?

--
Regards,
Alvin Bruney [Microsoft MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ http://www.lulu.com/owc
----------------------------------------------------------


<quiggle@u.washington.edu> wrote in message
news:1108604408.235467.66480@g14g2000cwa.googlegroups.com...
> If we were to disable the button after they pressed it, and there
> happen to be a validation error, then after the user fixed the problem,
> the button would still be disabled, and they would not be able to
> proceed.
>