【发布时间】:2014-09-17 05:28:53
【问题描述】:
添加文本框、单选按钮和提交按钮工作正常..
enter code here:
' $form = array();
$form['name'] = array(
'#title' => 'Your Name',
'#type' => 'textfield',
'#size' => '30',
);
$active = array(0 => t('Blog-Url'), 1 => t('Twitter-Name'));
$form['settings']['active'] = array(
'#type' => 'radios',
'#title' => t('Enter nature of the name'),
'#default_value' => isset($node->active) ? $node->active : 1,
'#options' => $active,
'#description' => t('Enter nature of the name, and characteritics.'),
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => 'Submit',
);
return $form;'
// 当点击提交按钮时,动作发生并插入数据库不起作用..
` 函数 sform_add_form_submit($form,$form_state){
$name = trim($form_state['values']['name']);
$formwem= $form_state['values']['settings']['active'];
$query = "INSERT INTO twittername (`name`,'Blogurt','Twitter_name') VALUES ('%s','%s','%s')";
$result = db_query($query, $name, $formwem ); `
请帮帮我....
【问题讨论】:
标签: drupal-7 drupal-modules drupal-forms