欢迎各位兄弟 发布技术文章
这里的技术是共享的
Hi,
I have very simple form with one ajax callback. I did it according example on official Form API reference page. I don't understand why it doesn't work.
<?php
function wishlist_status_form($form_state) {
$form['status'] = array(
'#type' => 'textfield',
'#title' => 'Status',
'#suffix' => '<div id="my-wrapper"></div>',
);
$form['ajax-submit'] = array(
'#type' => 'submit',
'#ajax' => array(
'callback' => 'wishlist_status_change',
'wrapper' => 'my-wrapper',
),
'#value' => t('Save'),
);
return $form;
}
function wishlist_status_change($form, $form_state) {
dpm($form_state, 'state callback');
return 'test';
}
?>
plz provide full documention code i have need it..........
In poll module they made good use of #ahah for adding dynamic rows for options. Look @it . Otherwise go though the http://ericlondon.com/tag/ahah and Introduction to AHAH Forms in Drupal
来自 https://drupal.org/node/1235710
I have already find it out.
I have already find it out. #ajax element is only from Drupal 7. In D6 I have to use #ahah attribute.
Log in or register to post comments