Drupal形成ahah元素,空的$ _POST问题 [英] Drupal form ahah element, problem with empty $_POST
问题描述
$ _ POST
为空。 $ _ POST ['form_build_id']
似乎需要从缓存中获取表单。有没有办法可以在drupal_get_form之后访问 $ _ POST ['form_build_id']
?我读到它可以保存到 $ form_state
变量,但我不知道如何。 drupal_get_form()
将 $ _ POST
数组保存到 $ form ['#post']
,我想。
如果您想查看模块添加选项,请查看< a href =http://api.drupal.org/api/drupal/modules--poll--poll.module/function/poll_choice_js/6 =nofollow> poll_choice_js()
,它不使用 drupal_get_form()
,而是建立本身。它帮助我理解了ahah过程。
I'm making a module for ubercart. It's nearly finished, but now I'm working on the admin page. I want the admin to be able to add options, like the poll module adds choices. The problem I have is that the admin form is generated through drupal_get_form, which leaves the $_POST
empty. $_POST['form_build_id']
seems to be needed to get the form from cache. Is there a way that the $_POST['form_build_id']
can be accesses after a drupal_get_form? I read that it could be saved to the $form_state
variable, but I don't know how.
drupal_get_form()
saves the $_POST
array into $form['#post']
, I think.
if you want to look at how poll module adds choices, have a look at poll_choice_js()
, which doesn't use drupal_get_form()
, but does the building itself. It helped me understand the ahah process.
这篇关于Drupal形成ahah元素,空的$ _POST问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!