Skip to content

Commit

Permalink
InfyOmLabs#272 checkbox fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mitulgolakiya committed Aug 31, 2016
1 parent 76ec65b commit eba6370
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Utils/HTMLFieldGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ public static function generateHTML(GeneratorField $field, $templateType)
break;
case 'checkbox':
$fieldTemplate = get_template('scaffold.fields.checkbox', $templateType);
$checkboxValue = $field->htmlValues[0];
if (sizeof($field->htmlValues) > 0) {
$checkboxValue = $field->htmlValues[0];
} else {
$checkboxValue = 1;
}
$fieldTemplate = str_replace('$CHECKBOX_VALUE$', $checkboxValue, $fieldTemplate);
break;
case 'radio':
Expand Down

0 comments on commit eba6370

Please sign in to comment.