PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Add CSS Class to field

  1. I am trying to add a new class to the textarea element for form number 7. Here is the code I am using:

    // Assign a CSS class to a Gravity Form field
    add_action("gform_field_css_class_7", "custom_class", 10, 3);
    function custom_class($classes, $field, $form){
        if($field["type"] == "textarea"){
            $classes .= " ckeditor";
        }
        return $classes;
    }

    It isn't working....
    What would I be doing wrong?

    Posted 12 years ago on Thursday June 9, 2011 | Permalink