ASP.Net IE6 disable button

Posted by RemotecUk on Stack Overflow See other posts from Stack Overflow or by RemotecUk
Published on 2010-04-16T12:43:57Z Indexed on 2010/04/19 18:33 UTC
Read the original article Hit count: 285

Filed under:
|
|
|

Hi, I have the following code running as part of my OnClientclick attribute on my custom ASP.Net button....

function clickOnce(btnSubmit) {
    if ( typeof( Page_ClientValidate ) == 'function' ) {
        if ( ! Page_ClientValidate() ) { 
            return false;
        }
    }    
    btnSubmit.disabled = true;        
}

There is a validator on the page.

  • If a given text box is empty then the validator activates no problem.
  • If a given text box is populated then the button disables but a post back does not occur.

The rendered markup looks like this...

<input type="submit" name="TestButton" value="Test Button" onclick="clickOnce(this);WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;TestButton&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" id="TestButton" class="euva-button-decorated" />

This works nicely in Firefox but not in IE6. Its almost like after the button has been disabled it simply does not run the post back javascript.

Any ideas welcomed.

EDIT: I have tried returning true from the function as well.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about ie6