Hello,
I am trying to simple add class to input element so I can use bootstrap classes etc. But I don't want to use javascript because it takes to long to fire depending on the page load.
So I am trying to achieve it with php. But I can only seem to add classes to the input container. Which is not helping my bootstrap integration.
I am using less for all the style adjustments that work beautifully with gravity forms.
It's just that I would like to customise the input size across different forms, and add classes to the inputs. I know I could use this code below and add another style to the bootstrap.
// ADD CLASS TO SIDEBAR INPUTS
add_action("gform_field_css_class", "sidebar_custom_class", 10, 3);
function sidebar_custom_class($classes, $field, $form){
if($form["id"] == 2 && $field["type"] == "text"){
$classes .= " input-block-level";
}
return $classes;
}
I'm curious if I can add classes to inputs directly to save the hassle of adding more styles.
Thanks