diff --git a/src/PhpWord/Shared/Html.php b/src/PhpWord/Shared/Html.php index ea532249..f917951b 100644 --- a/src/PhpWord/Shared/Html.php +++ b/src/PhpWord/Shared/Html.php @@ -244,11 +244,14 @@ class Html protected static function parseInput($node, $element, &$styles) { $attributes = $node->attributes; - - if (($type = $attributes->getNamedItem('type')->value) === 'checkbox') { - $checked = ($checked = $attributes->getNamedItem('checked')) && $checked->value === "true" ?? false; - $textrun = $element->addTextRun(); - $textrun->addFormField('checkbox')->setValue($checked); + $inputType = $attributes->getNamedItem('type')->value; + + switch ($inputType) { + case 'checkbox': + $checked = ($checked = $attributes->getNamedItem('checked')) && $checked->value === "true" ?? false; + $textrun = $element->addTextRun(); + $textrun->addFormField('checkbox')->setValue($checked); + break; } }