3
I’m working on a project in Rails, where in a view of the project I own several combobox, where at first I would like only one to be enabled, and according to the value selected the others are released. I think it would be interesting to use Javascript or/with jQuery to do this, but I have little knowledge in both. Can someone tell me how to do it ? A light so I can follow ?
It’s code I tried, but it didn’t work:
var update_field = function () {
if ($(".card") == 'Spell') {
$('.cardFamily').prop('disabled', false);
} else {
$('.cardFamily').prop('disabled', 'disabled');
}
};
$(update_field);