The “gform_field_choice_selected_type_form_editor” JavaScript filter in Gravity Forms allows the “input type” for choices (checkbox, radio) to be overridden. This hook is used when custom types have been created and will only be needed with such a special case.


gform.addFilter( 'gform_field_choice_selected_type_form_editor', function( type, field ) {
    // do stuff
    return type;
} );


  • type string

    The choice selected input type. Defaults to checkbox for checkbox type fields or radio for other field types.

  • field Field Object

    The current field.


add_action( 'gform_admin_pre_render', 'set_choice' );
function set_choice( $form ) {
    <script type="text/javascript">
        gform.addFilter('gform_field_choice_selected_type_form_editor', 'set_choice');
        function set_choice(type, field){
            if ( == 1 ){
            	type = 'radio';
            return type;
    //return the form object from the php hook
    return $form;


Your code snippet should be placed in the functions.php file of your active theme.

Source Code

This filter is located in the function GetFieldChoices() in gravityforms/js.php