【发布时间】:2015-02-04 06:05:45
【问题描述】:
Forms API 中的表单控件有 id 吗?以下是我的示例代码:
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;
}
对于这个非常简单的初学者问题很抱歉,但是如何在上面的示例中识别我的按钮 ID(例如)$form['id']['myphoto_button']?
【问题讨论】:
-
我投票决定将此问题作为题外话结束,因为它一直是cross-posted on Drupal Answers