mardi 3 février 2015

Identify form control id in Drupal 7 Forms API


Vote count:

0




Does form controls in Forms API have id's? Below is my sample code:



function myid_user_page_form(){
$form = array();
$form['id'] = array(
'#type' => 'fieldset',
'#title' => t('ID Information'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['id']['myphoto_button'] = array(
'#type' => 'button',
'#value' => '...',
'#attributes' => array(
'onclick' => "myphoto_options();",),
);
return $form;
}


Sorry for this very simple beginner's question but how to identify my button's id in the sample above(e.g) $form['id']['myphoto_button']?



asked 58 secs ago







Identify form control id in Drupal 7 Forms API

Aucun commentaire:

Enregistrer un commentaire