1
我有一個表格A和B形Drupal 7的鍊形成一個
我想作形式的用戶重定向到形成B AND告知形式的
做出的選擇的B型A型的提交功能(不工作):
function recruitment_select_team_submit($form, &$form_state)
{
// Forward to the next page.
$items['yourmod/foo/%/delete'] = array(
'title' => 'goto next page',
'page callback' => 'drupal_get_form',
'page arguments' => array('recruitment_form', 1), // second argument is the paramter for the team_id (test value)
//'access arguments' => array('delete foo rows'),
'access callback' => TRUE,
'type' => MENU_CALLBACK,
);
return $items;
}
表格B的形式:
function recruitment_form()
{
$team_id = 1;
if(db_query('select count(*) from gm_team where id = :team_id',array(':team_id' => $team_id))->fetchfield() == 0)
{
die('Sorry but the team with team ID '.$team_id.' does not exist. If you feel this is a mistake please contact us.');
}
$team_terms = db_query('select terms from gm_team where id = :team_id',array(':team_id' => $team_id))->fetchfield();
$team_requirements = db_query('select recruit_requirements from gm_team where id = :team_id',array(':team_id' => $team_id))->fetchfield();
......
}
您可以使用1)Db來存儲數據,以便表單都可以訪問它。 2)至於重定向,你可以做到這一點與jquery –
[這](http://growingventuresolutions.com/blog/drupal-7-multistep-forms-using-variable-functions)可能會幫助你 – hampusohlsson
hakanito的鏈接是正確的處理這種情況的方法,除非你真的有理由不把它做成多種形式。 – Coder1