Drupal form_submit不起作用

时间:2015-03-03 19:57:46

标签: forms drupal drupal-form-submission

我正在尝试为Dr Drupal 7发送一个简单的服装,但我无法得到它来获取变量,它回到我的形式,但没有任何值或尝试打印它们但没有。请帮助

<?php

function augusto_menu() {
$items = array();


 $items['augusto_form'] = array( 
'title' => 'Form augusto', 
'description' => 'Form Drupal.',
'page callback' => 'drupal_get_form', 
'page arguments' => array('augusto_form'), 
'access callback' => TRUE
 );

return
$items;
}
function augusto_form($form, &$form_state) {

$form['name'] = array(
'#type' => 'textfield',
'#title' => 'Name',
'#size' => 18,
'#maxlength' => 20,
'#required' => TRUE, 
 );
 $form['last'] = array(
'#type' => 'textfield',
'#title' => 'last',
'#size' => 18,
'#maxlength' => 20,
'#required' => TRUE,
  );


//tax
$dropdown_source = taxonomy_get_tree(4);
foreach ($dropdown_source as $item) {
$key = $item->tid;
$value = $item->name;
$dropdown_array[$key] = $value;
}


 $form['submit'] = array(
'#type' => 'submit',
'#value' => t('send'),
 );

 return $form;
 }


 function augusto_submit(&$form, &$form_state) {



$values = array(
$name = $form_state['values']['name'];
$last = $form_state['values']['last'];

drupal_goto( “/ augusto_form /".$名。”/” $最后。);     }

1 个答案:

答案 0 :(得分:1)

function augusto_submit(&$form, &$form_state)更改为function augusto_form_submit(&$form, &$form_state)