Skip to content

Commit

Permalink
Fix bug where Checkboxe & Radio ignore "required" option.
Browse files Browse the repository at this point in the history
  • Loading branch information
Felixkat committed Nov 14, 2024
1 parent d9006d4 commit e62bfce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions framework/elements/formbuilder/formbuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
$field_option_params = Helper::loadParams($field_option['params']);
$checked = $field_option_params->get('opt_selected', 0) == 1 ? ' checked' : '';
echo '<div class="form-check">';
echo '<input class="form-check-input" type="checkbox" value="'.$field_option_params->get('opt_value', '').'" name="as-form-builder-['.$form_builder_item['field_name'].']" id="as-form-builder-checkbox-'.$form_builder_item['field_name'].'-'.$key_opt.'"'.$checked.'>';
echo '<input class="form-check-input" type="checkbox" value="'.$field_option_params->get('opt_value', '').'" name="as-form-builder-['.$form_builder_item['field_name'].']" id="as-form-builder-checkbox-'.$form_builder_item['field_name'].'-'.$key_opt.'"'.$checked.'.'.$required.'>';
echo '<label class="form-check-label" for="as-form-builder-checkbox-'.$form_builder_item['field_name'].'-'.$key_opt.'">'.$field_option_params->get('opt_text', '').'</label>';
echo '</div>';
}
Expand All @@ -117,7 +117,7 @@
$field_option_params = Helper::loadParams($field_option['params']);
$checked = $field_option_params->get('opt_selected', 0) == 1 ? ' checked' : '';
echo '<div class="form-check">';
echo '<input class="form-check-input" type="radio" value="'.$field_option_params->get('opt_value', '').'" name="as-form-builder-['.$form_builder_item['field_name'].']" id="as-form-builder-checkbox-'.$form_builder_item['field_name'].'-'.$key_opt.'"'.$checked.'>';
echo '<input class="form-check-input" type="radio" value="'.$field_option_params->get('opt_value', '').'" name="as-form-builder-['.$form_builder_item['field_name'].']" id="as-form-builder-checkbox-'.$form_builder_item['field_name'].'-'.$key_opt.'"'.checked.'.'.$required.'>';
echo '<label class="form-check-label" for="as-form-builder-checkbox-'.$form_builder_item['field_name'].'-'.$key_opt.'">'.$field_option_params->get('opt_text', '').'</label>';
echo '</div>';
}
Expand Down

0 comments on commit e62bfce

Please sign in to comment.