jeudi 21 mai 2015

Efficient way to enable rails submit button on checked checkbox

I disable update submit buttons in all forms, and enable them on keyup.

$(function(){
  $("#submitAccount, #submitProfile, #submitUser").attr("disabled","true");
  $(".form-control").keyup(function(){
    $("#submitAccount").removeAttr("disabled");
  });
});

The problem is, in my users edit form, I also have some checkboxes to set some permissions.

What would be an efficient way to remove the disabled attribute on checking/unchecking one of the checkboxes?




Aucun commentaire:

Enregistrer un commentaire