How to remove medium size class in gravity form for input tag?

I want to remove classes or replace class name with custom class names on a Gravity Forms email input field.

I found this solution:

add_filter( ‘gform_field_css_class_3’, ‘custom_class’, 10, 3 );
function custom_class( $classes, $field, $form ) {
if ($field->type == ’email’ ) {
$classes .= ‘ form-control formbox’;
}

return $classes;
}

But after running this code from function.php it did not work.
This is the output after it’s run:

<li id=”field_3_3″ class=”gfield field_sublabel_below field_description_below gfield_visibility_visible form-control formbox”>
<label class=”gfield_label” for=”input_3_3″>email</label>
<div class=”ginput_container ginput_container_email”>
<input name=”input_3″ id=”input_3_3″ value=”” class=”medium” aria-invalid=”false” type=”email”>
</div>
</li>

This solution replaces CSS classes for the li tags. I’m looking for a way to change class name for input tags only.

Read more here:: How to remove medium size class in gravity form for input tag?

Leave a Reply

Your email address will not be published. Required fields are marked *