I have a submit button in a form in ruby
f.submit btn_text, class: "btn btn-one mgt12 mgb12", id: "btn_id"
I want to make this button disabled by ruby without using any javascript
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.
Approach: To enable or disable the form submit button, we use the below code snippet. $('#enabled'). click(function () { if ($('#submit-button').is(':disabled')) { $('#submit-button'). removeAttr('disabled'); } else { $('#submit-button').
document. getElementById("submit"). disabled = true; for the button to get disabled.
Add disabled: true
option.
f.submit btn_text,
class: "btn btn-one mgt12 mgb12",
id: "btn_id",
disabled: true
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