Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Drupal - Put form in hook_page_build

  • 20-07-2015 10:14am
    #1
    Registered Users, Registered Users 2 Posts: 4,258 ✭✭✭


    I'm trying to create a form that's displayed as a popup when the function is called.

    I'm trying to do this using hook_page_build
    
    
    
    
    salesforcedara_form($form, &$form_state) {
      
     $form['trek'] = array(
        '#type' => 'textfield', //you can find a list of available types in the form api
        '#title' => 'Please enter your TREK serial number',
        '#required' => TRUE, //make this field required 
      );
      
    
    $form['submit_button'] = array(
        '#type' => 'submit',
        '#value' => t('Submit'),
      );
      
      return $form;
    }
    
    ////////////////////////////////////////////////////////////
    
    /*
    ** Implements hook_page_build
    */
    
    function salesforcedara_page_build(&$page) {
     
        // We are on a node detail page. Append a standard disclaimer to the
        // content region.
        $page ['content']['form'] = array(
          '#markup' => t('TREK serial number validater'),
          '#weight' => 25,
        );
      
    }
    
    


Comments

  • Moderators, Society & Culture Moderators Posts: 17,643 Mod ✭✭✭✭Graham


    Did you just stop by to let everyone know you're working on a form or did you forget to attach a question?


  • Registered Users, Registered Users 2 Posts: 4,258 ✭✭✭swingking


    Sorry my question is why isn't this working.

    I have everything setup correctly.

    It just refuses to run the form as a pop up.

    Thanks


Advertisement