Home All Groups Group Topic Archive Search About

Disable submit button after click but fire validators?

Author
16 Dec 2005 10:50 AM
Chris Ashley
I have an ImageButton which I would like to have the following
behaviour:

(1) User clicks button, button is disabled.

(2) Page validators fire

(3) If page fails client side validation, reenable button. Otherwise
submit.

I have tried the following code but it is not working:

JS:

function btnSave() {
      document.all["next"].Disabled = true;
      Page_ClientValidate();
     document.all["next"].Disabled = !Page_BlockSubmit;
}

..NET:

next.Attributes.Add("onclick","btnSave()");

Anybody have any ideas?

Author
16 Dec 2005 11:39 AM
David Jessee
change Disabled to disabled (lower case);

Show quote
"Chris  Ashley" wrote:

> I have an ImageButton which I would like to have the following
> behaviour:
>
> (1) User clicks button, button is disabled.
>
> (2) Page validators fire
>
> (3) If page fails client side validation, reenable button. Otherwise
> submit.
>
> I have tried the following code but it is not working:
>
> JS:
>
> function btnSave() {
>       document.all["next"].Disabled = true;
>       Page_ClientValidate();
>      document.all["next"].Disabled = !Page_BlockSubmit;
> }
>
> ..NET:
>
> next.Attributes.Add("onclick","btnSave()");
>
> Anybody have any ideas?
>
>

AddThis Social Bookmark Button