Disable button?

Results 1 to 3 of 3

Thread: Disable button?

  1. #1
    Renidea Guest

    Default Disable button?

    Is there a way to enable/disable buttons in HTML/ASP like in Visual Basic?

  2. #2
    Sreedharan Guest

    Default RE: Disable button?

    In HTML just include the Disabled attribute. Eg<BR><BR>&#060;input type="submit" name="cmdOK" value="OK" disabled&#062;<BR><BR>In Javascript, you can enable or disable the above button by<BR><BR>document.forms[0].cmdOK.disabled = true; // This will disable it<BR>document.forms[0].cmdOK.disabled = false; // This will enable it<BR><BR><BR>

  3. #3
    Sreedharan Guest

    Default RE: Disable button? - Here you are

    &#060;input type="button" name="cmdOK" value="OK" disabled&#062;<BR><BR>The above will disable the button.<BR><BR>Make sure you have some Javascript code to enable the button based on some event(or you will have to submit the form again, and have VBScript code to enable it, by omitting the disabled attribute above.)<BR><BR>To enable the button in Javascript:<BR>document.forms[0].cmdOK.disabled = false;<BR><BR>To disable the button in Javascript:<BR>document.forms[0].cmdOK.disabled = true;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts