Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a disabled submit button in rails

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

like image 425
Omar Avatar asked Jul 28 '16 13:07

Omar


People also ask

How do I make my submit button disabled?

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.

How do I enable a submit button?

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').

How enable and disable submit button in laravel?

document. getElementById("submit"). disabled = true; for the button to get disabled.


1 Answers

Add disabled: true option.

f.submit btn_text,
  class: "btn btn-one mgt12 mgb12",
  id: "btn_id",
  disabled: true
like image 118
Arup Rakshit Avatar answered Oct 11 '22 22:10

Arup Rakshit