I know the following works:
<input type="text" disabled="disabled" />
<button disabled="disabled">
But how would you disable this?
<input type="submit" ....>
Any idea? Do I have to use javascript?
Thanks.
Okay. It might have been my Firefox problem. I swear I did use the same synatx. Thanks, and sorry for such a silly question?
1.1 To disable a submit button, you just need to add a disabled attribute to the submit button. $("#btnSubmit"). attr("disabled", true); 1.2 To enable a disabled button, set the disabled attribute to false, or remove the disabled attribute.
The disabled attribute is a boolean attribute. When present, it specifies that the element should be disabled. A disabled element is unusable.
We can easily disable input box(textbox,textarea) using disable attribute to “disabled”. $('elementname'). attr('disabled','disabled'); To enable disabled element we need to remove “disabled” attribute from this element.
Just click f12 in your browser, find the submit button in the html, and then remove the disabled ! It will submit the form even if the inputs are empty.
You can use disabled="disabled"
on input
's that are of type submit
:
<input type="submit" disabled="disabled" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With