$form['dateinput'] = array(
'#id'=>'mydate',
'#title' => t('输入日期'),
'#type' => 'textfield',
'#size' => '50',
'#required' => TRUE,
'#attributes' => array('onClick' => 'MyCalendar.SetDate(this)')
);
注意描红的部分
转载于:https://my.oschina.net/wangwang110/blog/10232