Skip to content

Commit

Permalink
Select the checked options on radio button group.
Browse files Browse the repository at this point in the history
Select checked options on radion button group at front-end editing module.
  • Loading branch information
Dang Quoc Dat authored Mar 20, 2017
1 parent 3072199 commit 0ac5c9f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion source/plg_system_t3/base-bs3/js/frontend-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,18 @@
input.prop('checked', true).trigger('change');
}
});

$(".btn-group input[checked=checked]").each(function()
{
if ($(this).val() == '') {
$("label[for=" + $(this).attr('id') + "]").addClass('active btn-primary');
} else if ($(this).val() == 0) {
$("label[for=" + $(this).attr('id') + "]").addClass('active btn-danger');
} else {
$("label[for=" + $(this).attr('id') + "]").addClass('active btn-success');
}
});

});

}(jQuery);
}(jQuery);

0 comments on commit 0ac5c9f

Please sign in to comment.