I am trying to implement this codepen.io into my PHP form where all fields come from a database.
Php Code:
<?php if ($type == 'recaptcha') { ?>
<label class="control-label col-md-2"></label>
<?php } else { ?>
<label class="control-label col-md-2 <?php if (!empty($error)) { ?>has-error<?php } ?>" for="<?php echo $element_id ?>"><?php echo $title ?></label>
<?php } ?>
<div class="input-group col-md-9 <?php if (!empty($error)) { ?>has-error<?php } ?>">
<?php echo $item_html ?>
</div>
<span class="help-block">
<div class="element_description"><?php echo $description ?></div>
<?php if ($error) { ?>
<div class="element_error has-error"><?php echo $error ?></div>
<?php } ?>
</span>
Now it shows like this:
I have tried a few things but everything comes from
<?php echo $item_html ?>
So I can't really seperate the dynamic labels. Can anyone guide me how to achieve this?