locked
Trying to disable a submit button after clicking it so it does not get clicked twice. RRS feed

  • Question

  • I have a login screen that has a simple submit button.  After the user taps on it, I want to disable the button so they can not hit it again until either it logs in or an error occurs.

    I tried to do something like:

    var x = GetDocumentById("submitId").wincontrol

    x.disabled = true

    but with no luck. 

    Thanks, -Peter


    Peter Kellner http://peterkellner.net Microsoft MVP • ASPInsider

    Wednesday, October 31, 2012 2:13 AM

Answers

  • Hi,

    Please using the code as follow to disable a button:

    document.getElementById("btn1").disabled = "disabled";


    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com
    Microsoft One Code Framework

    • Marked as answer by Song Tian Tuesday, November 6, 2012 10:33 AM
    Thursday, November 1, 2012 2:51 AM