Add possible values for custom fields of type checkbox

This commit is contained in:
Ivan Nieto Vivanco 2022-09-15 11:18:54 -05:00
parent abd2349604
commit 20220764bb

View file

@ -46,7 +46,9 @@
<input type='radio' name="default_values[{{ $field->id }}]" value="{{$field_value}}" {{ $field->defaultValue($model_id) == $field_value ? 'checked="checked"': '' }} />{{ $field_value }}<br />
@endforeach
@elseif($field->element == "checkbox")
<input type='checkbox' name="default_values[{{ $field->id }}]" {{ $field->defaultValue($model_id) ? 'checked="checked"': '' }}/>
@foreach(explode("\r\n", $field->field_values) as $field_value)
<input type='checkbox' name="default_values[{{ $field->id }}]" value="{{$field_value}}" {{ $field->defaultValue($model_id) == $field_value ? 'checked="checked"': '' }} /> {{ $field_value }}<br />
@endforeach
@else
<span class="help-block form-error">
Unknown field element: {{ $field->element }}