Trying to print a form with a shortcode I'm currently working on a drupal module and I want to print a specific form called by a shortcode. So I've use this tuto and here is my code :

Info :

    function custom_shortcodes_shortcode_info() {
      $shortcodes['form'] = array(
        'title' =&gt; t('Link form'), 
        'description' =&gt; t('A simple form.'), 
        'process callback' =&gt; 'custom_shortcodes_shortcode_form',
      );
      return $shortcodes;
    }


Callback:

    function custom_shortcodes_shortcode_form($attrs, $text) {
      $attrs = drupal_get_form('custom_shortcodes_shortcode_form_attributes');
      return $attrs;
    }


Form :

    function custom_shortcodes_shortcode_form_attributes() {
      $form = array();
      $form['PrjLogement'] = array(
        '#type' =&gt; 'textfield',
        '#title' =&gt; t('Field1'),
        '#required' =&gt; TRUE
      );

      $form['MenageRevenuM'] = array(
        '#type' =&gt; 'textfield',
        '#title' =&gt; t('Field2'),
        '#required' =&gt; TRUE
      );

      $form['MenageApport'] = array(
        '#type' =&gt; 'textfield',
        '#title' =&gt; t('Field3'),
        '#required' =&gt; TRUE
      );

      $form['submit'] = array(
        '#type'=&gt;'submit',
        '#value'=&gt;t('Submit')
      );

      return $form;
    }


Now the thing is that every time I'm calling the form with the specific shortcode the output is just "Array".
Is there any way to print this form ?
Thanks in advance for your help.
Basically, drupal_get_form doesn't render the array - it just returns the renderable array from the form function. You need to render it yourself.

Try this:

function custom_shortcodes_shortcode_form($attrs, $text) {
  $form = drupal_get_form('custom_shortcodes_shortcode_form_attributes');
  $attrs = drupal_render($form);
  return $attrs;
}