Disable submit button after click but fire validators?

Discussion in 'ASP .Net' started by Chris Ashley, Dec 16, 2005.

  1. Chris  Ashley

    Chris Ashley Guest

    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?
     
    Chris Ashley, Dec 16, 2005
    #1
    1. Advertisements

  2. Chris  Ashley

    Guest Guest

    change Disabled to disabled (lower case);
     
    Guest, Dec 16, 2005
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.