By mysocom on
I have some module configuration form and I want to add a flash content before form output. How can I do it ?
Here is a code:
$items['album/add'] = array(
'title' => 'Add city',
'page callback' => 'drupal_get_form',
'page arguments' => array('album_form'),
'access arguments' => array('administer site configuration'),
'type' => MENU_LOCAL_TASK,
'weight' => 2,
);
and form looks like that
function album_form(&$form_state, $album = null)
{
$form['title'] = array(
'#title' => 'Город',
'#description' => 'Город проекта',
'#type' => 'textfield',
'#default_value' => $album ? $album->title : '',
'#required' => true,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => $album ? 'Сохранить' : 'Добавить',
);
if ($album)
{
$form['сid'] = array(
'#type' => 'value',
'#value' => $album->cid,
);
}
return $form;
}
Comments
Put this to begin of the
Put this to begin of the function;
$form['flash']['#markup'] = 'your html code';