• 0

Question on HTML submit button


Question

Is there any other value besides disable="disable" ? I want to be able to turn disable on and off on a submit button via script e.g. disable="false" (this doesn't work btw), I looked it up on the internet but I can't find any other value other than disable="disable".

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Nope, there isn't any other value for the disabled attribute. Instead of changing the value, you can either remove the attribute altogether and/or (if it doesn't work) you can replace the original button with an another code snippet.

Plain JS for removing an attribute:

var mybutton = document.getElementById('mybutton');
mybutton.removeAttribute('disabled');

Same using jQuery library:

$('#mybutton').removeAttr('disabled');

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.