When I select the “other” in a list of radio buttons,
the gray field is prefilled with the word “other”.
Is there a way to make the gray field empty by default?
However, I want ‘Other’ of the radio button to be displayed as it is.
I want to empty the inside of the red box like the image below.
You can use the gform_other_choice_value filter to return an empty string:
add_filter( 'gform_other_choice_value', 'empty_other_choice_value', 10, 2 );
function empty_other_choice_value( $value, $field ) {
// apply to field 6 in form 25 only
if ( is_object( $field ) && 6 === $field->id && 25 === $field->formId ){
$value = '';
}
return $value;
}
This is PHP code that can be added to your theme functions.php file, or you can use a plugin such as this one to keep the code separate from the theme: Code Snippets – WordPress plugin | WordPress.org