<div class="form-group">
<label class="w-20" id="loan_no_label"><?= "<font class='red'> * </font>" . __('loan-number') ?></label>
<input class="w-65 form-control" id="loan_no" required type="text" name="loan_no" />
</div>
$('#is_all_loan').on('click', function() {
var checked = $(this);
if (checked.is(':checked')) {
$('#loan_no_label').html('<?= __('loan-number'); ?>');
$('#loan_no').attr('required', false);
} else {
$('#loan_no_label').html("<font class='red'> * </font>貸款編號");
$('#loan_no').attr('required', true);
}
});