if fields of type 'checkbox' have a default value, the will have a hidden input field to set this value

This commit is contained in:
Uwe Steinmann 2023-10-13 11:38:51 +02:00
parent 437f9e894f
commit 3eb830855a

View File

@ -1201,6 +1201,8 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
default:
switch($value['type']) {
case 'checkbox':
if(isset($value['default']) && !empty($value['name']))
echo '<input type="hidden" name="'.$value['name'].'" value="'.$value['default'].'" />';
echo '<div class="form-check">';
echo '<input'.
(!empty($value['type']) ? ' type="'.$value['type'].'"' : '').