Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Hide certain fields from the form in Drupal

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 312
    Comment on it

    In order to hide certain fileds from form in drupal

    function hook_form_alter(&$form, &$form_state, $form_id) 
     {
        if ($form['form_id']['#id'] == 'fomr-id')
        {
          $form['field_yourfield']['#access'] = FALSE;
          // if you want it to be visible, but disabled then:
          $form['field_yourfield']['#disabled'] = TRUE;
        }
     }  
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: