I've successfully added a dropdown option in form administration directly under the field label using gform_field_standard_settings. This dropdown is showing for ALL fields EXCEPT for the hidden field. Is there a separate hook I need to use to add the dropdown to the hidden field type as well?
Here's the code I'm using to add the dropdown. Any help would be greatly appreciated.
// ADD ADF FIELD IDENTIFIER TO ALL FIELDS
add_action("gform_field_standard_settings", "my_standard_settings", 10, 2);
function my_standard_settings($position, $form_id){
// Create settings on position 25 (right after Field Label)
if($position == 25){
?>
<li class="admin_label_setting field_setting" style="display: list-item; ">
<label for="adf_field">ADF Field Type
<!-- Tooltip to help users understand what this field does -->
<a href="javascript:void(0);" class="tooltip tooltip_form_field_placeholder" tooltip="<h6>ADF Field Type</h6>To pass a form value as an ADF form field, please select an option from the list below.">(?)</a>
</label>
<select id="adf_field" name="adf_field" onchange="SetFieldProperty('adf_field', this.value);">
<option value="0">PLEASE SELECT</option>
<option value="CustomerName">CUSTOMER : Name</option>
<option value="CustomerEmail">CUSTOMER : Email</option>
<option value="CustomerPhone">CUSTOMER : Phone</option>
<option value="CustomerComments">CUSTOMER : Comments</option>
<option value="VehicleYear">VEHICLE : Year</option>
<option value="VehicleMake">VEHICLE : Make</option>
<option value="VehicleModel">VEHICLE : Model</option>
<option value="VehicleComments">VEHICLE : Comments</option>
<option value="VendorName">VENDOR : Name</option>
<option value="VendorContact">VENDOR : Contact</option>
<option value="VendorPhone">VENDOR : Phone</option>
<option value="VendorEmail">VENDOR : Email</option>
<option value="ProviderName">PROVIDER : Name</option>
<option value="ProviderService">PROVIDER : Service</option>
<option value="ProviderURL">PROVIDER : URL</option>
<option value="ProviderEmail">PROVIDER : Email</option>
<option value="ProviderPhone">PROVIDER : Phone</option>
</select>
</li>
<?php
}
}
// SAVE AND LOAD FIELD SETTING ON ADMIN SIDE
add_action("gform_editor_js", "my_gform_editor_js");
function my_gform_editor_js(){
?>
<script>
//binding to the load field settings event
jQuery(document).bind("gform_load_field_settings", function(event, field, form){
jQuery("#adf_field").val(field["adf_field"]);
});
</script>
<?php
}