<div id="select-box-<?php echo $id; ?>" class="form-group<?php echo (isset($errors) && $errors->has($errorKey) ? ' has-error' : ''); ?><?php echo $parentHidden ? ' parent-hidden' : ''; ?>" style="<?php echo !empty($hide) ? 'display:none' : ''; ?>">
    <?php echo Form::label($id, ucfirst($label), array('class' => 'control-label')); ?>

    <?php if(!empty($contentType)): ?>
        <button type="button" class="btn btn-xs btn-default command-add-item pull-right">
            <span class="icon glyphicon glyphicon-plus"></span>
        </button>
    <?php endif; ?>
    <?php if($enabled): ?>
        <div id="select-box-<?php echo $id; ?>-wrapper"<?php echo (isset($errors) && $errors->has($errorKey) ? ' data-toggle="tooltip" title="' . $errors->first($errorKey) . '"' : ''); ?>>
            <?php echo Form::select($name, $list, $value, array(
                'id' => $id, 'class' => 'form-control')); ?>

        </div>
    <?php else: ?>
        <?php echo Form::select($name . "-sel", $list, $value, array(
            'id' => $id . "-sel", 'class' => 'form-control',
            'data-toggle' => (isset($errors) && $errors->has($errorKey) ? 'tooltip': null),
            'title' => (isset($errors) && $errors->has($errorKey) ? $errors->first($errorKey): null),
            'disabled' => 'disabled' )); ?>

        <?php echo Form::hidden($name, $value, array("id" => $id)); ?>

    <?php endif; ?>
    <?php if(!empty($info)): ?>
        <span id="helpBlock" class="help-block"><?php echo $info; ?></span>
    <?php endif; ?>
</div>

<script>
    $(function(){
        var selectBoxField<?php echo $id; ?> = new Eae.View.BackendGenericSelectBox({
            el: $("#select-box-<?php echo $id; ?>"),
            parent:  <?php echo empty($parent) ? 'false': json_encode($parent); ?>,
            search: <?php echo $searchable ? 'true' : 'false'; ?>,
            contentType:  <?php echo empty($contentType) ? 'false': json_encode($contentType); ?>

        });    
    });
</script>
   