select控制如何使用ahah动态改变信息?

由 winner 于 周五, 2008-02-29 12:45 提交。

select控制如何使用ahah动态改变信息?

在poll模块中,使用submit按键+ahah动态添加textbox文本,代码如下:

  $form['choice_wrapper']['poll_more'] = array(
    '#type' => 'submit',
    '#value' => t('More choices'),
    '#description' => t("If the amount of boxes above isn't enough, click here to add more choices."),
    '#weight' => 1,
    '#submit' => array('poll_more_choices_submit'), // If no javascript action.
    '#ahah' => array(
      'path' => 'poll/js',
      'wrapper' => 'poll-choices',
      'method' => 'replace',
      'effect' => 'fade',
    ),
  );

在select中如何实现,主要是在选中select中选项时,如何得到select选项值? 以便根据这个选项值动态改变相应的,二级选项,大家有没有这方面的样例,多谢了