<label for="type">Field Type</label>
<select class="form-control show-tick chosen-select-<?php echo($wo['field']->id) ?>" id="type" name="type">
  <option value="textbox" <?php echo($wo['field']->type == 'textbox' ? 'selected' : '') ?>>Textbox</option>
  <option value="textarea" <?php echo($wo['field']->type == 'textarea' ? 'selected' : '') ?>>Textarea</option>
  <option value="selectbox" <?php echo($wo['field']->type == 'selectbox' ? 'selected' : '') ?>>Select box</option>
</select>
<div class="clearfix"></div>
<br>
<div class="form-group form-float">
    <div class="form-line focused">
      <label class="form-label">Field Name</label>
        <input type="text" id="name" name="name" class="form-control" value="<?php echo($wo['field']->name) ?>">
    </div>
</div>

<div class="form-group form-float">
    <div class="form-line focused">
      <label class="form-label">Field Length: <small>Default value is 32, and max value is 1000</small></label>
        <input type="text" id="length" name="length" class="form-control" value="<?php echo($wo['field']->length) ?>">
    </div>
</div>
 <div class="form-group form-float">
    <div class="form-line focused">
      <label class="form-label">Field Description: <small>The description will show under the field</small></label>
        <textarea name="description" id="description" class="form-control" cols="30" rows="3"><?php echo($wo['field']->description) ?></textarea>
    </div>
</div>
<label for="required">Required Field <small>(Can Not Be Empty)</small></label>
<select class="form-control show-tick chosen-select" id="required" name="required">
  <option value="on" <?php echo($wo['field']->required == 'on' ? 'selected' : '') ?>>Required</option>
  <option value="off" <?php echo($wo['field']->required == 'off' ? 'selected' : '') ?>>Not Required</option>
</select>
<div class="clearfix"></div>
<br><br>
<div class="form-group form-float options_<?php echo($wo['field']->id) ?>" style="display:none">
    <div class="form-line focused">
      <label class="form-label">Select Field Options: <small>One option per line.</small></label>
        <textarea name="options" id="options" class="form-control" cols="30" rows="3"><?php echo str_replace(',', "\n", $wo['field']->options)?></textarea>
    </div>
</div>
<input type="hidden" name="id" value="<?php echo($wo['field']->id) ?>">
<script type="text/javascript">
  $(document).on('click', '.chosen-select-<?php echo($wo['field']->id) ?>', function(event) {
    var selectedValue = $(this).val();
     if (selectedValue == 'selectbox') {
        $('.options_<?php echo($wo['field']->id) ?>').fadeIn(200);
     } else {
        $('.options_<?php echo($wo['field']->id) ?>').fadeOut(200);
     }
  });
</script>