How do I display a help text with field form? Is there a way to bring up a help message next to a form field as below?

FooForm.php

$form['field_foo'] = array(
    '#type'          =&gt; 'textfield',
    '#title'         =&gt; t('Foo'),
    '#required'      =&gt; true,
    '#default_value' =&gt; 'foo',
    '#help_text' =&gt; 'Help text for Foo field',
);
Use #description attribute.

$form['field_foo'] = array(
  '#type'          =&gt; 'textfield',
  '#title'         =&gt; t('Foo'),
  '#required'      =&gt; true,
  '#default_value' =&gt; 'foo',
  '#description' =&gt; t('Help text for Foo field'), 
);