This commit is contained in:
2026-06-21 09:38:35 -04:00
parent ef1f397ed6
commit 7265f778e8

View File

@@ -161,7 +161,10 @@ function vs01_render_field_multiselect($field, $value = '') {
function vs01_render_field($field, $submitted_values = []) {
$id = $field['id'] ?? '';
$type = $field['type'] ?? 'text';
$value = $submitted_values[$id] ?? '';
// A schema field may declare a "default" (e.g. ho_total_units => 0) so the
// input isn't left blank on first render. Submitted values always win;
// this only applies on the initial, un-submitted render of the form.
$value = $submitted_values[$id] ?? (isset($field['default']) ? (string) $field['default'] : '');
switch ($type) {
case 'text': $html = vs01_render_field_text($field, $value); break;