How to add drupal 7 webform wrapper class ?

Hi,

Any option is available to add class to drupal webform submit button wrapper div 

Add Comment



  • 2 Answer(s)

    Try this one 

    Step 1

    function themename_form_alter(&$form, &$form_state, $form_id) {
    }
    
    

    Change themename with your theme name 

    Step 2

    switch ($form_id){
    }
    
    

     

    Step 3

    case "webform_client_form_50":
    $form['actions']['#attributes']['class'][] = 'd-inline-block';
    $form['submitted']['email']['#theme_wrappers'] = array(); // this is for remove wrapper div for form fields 
    break;
    
    

     

    webform_client_form_50 change with your form id

    Answered on April 5, 2018.
    Add Comment

    Full code

    function themename_form_alter(&$form, &$form_state, $form_id) {
    
     switch ($form_id){
    
     case "webform_client_form_50":
    
     $form['actions']['#attributes']['class'][] = 'd-inline-block';
    
     $form['submitted']['email']['#theme_wrappers'] = array(); // this is for remove wrapper div for form fields 
    
     break; 
    
     }
    
    }
    
    
    Answered on April 5, 2018.
    Add Comment



  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.