Skip to content

Commit

Permalink
Fix checkboxes and radioboxes not working
Browse files Browse the repository at this point in the history
  • Loading branch information
sonvnn committed Feb 4, 2025
1 parent 8dc411d commit 16d17f6
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 @@ -126,7 +126,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.'.'.$required.'>';
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 @@ -139,7 +139,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.'.'.$required.'>';
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 16d17f6

Please sign in to comment.