Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
254 views
in Technique[技术] by (71.8m points)

php - Drupal form ahah element, problem with empty $_POST

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...