<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Since you set #tree to TRUE for 'listname' you need to use
$form_values['listname']['list_name'] and
$form_values]['listname']['description'] to get the values<br>
<br>
Nevets<br>
<blockquote type="cite">
<div class="moz-text-plain" wrap="true" graphical-quote="true"
style="font-family: -moz-fixed; font-size: 13px;" lang="x-western">
<pre wrap="">Hello,
I have a form:
function contactlistcreate() {
$form = array();
$form['listname'] = array(
'#type' => 'fieldset',
'#title' => t('Create new list'),
'#tree' => TRUE,
);
$form['listname']['list_name'] = array(
'#type' => 'textfield',
'#title' => t('List name'),
'#size' => 30,
'#maxlength' => 64,
'#description' => t('Enter the list name'),
'#default_value' => 'dddodododod',
);
$form['listname']['description'] = array(
'#type' => 'textarea',
'#title' => t('Describe it'),
'#cols' => 60,
'#rows' => 5,
'#description' => t('List description.'),
);
$form['listname']['submit'] = array('#type' => 'submit', '#value' => t('Save'));
return $form;
}
and submit function:
function contactlistcreate_submit($form_id, $form_values) {
db_query(
"INSERT INTO {contactsliststable} (contacts_list_name, contacts_list_description) VALUES ('%s', '%s')", $form_values['list_name'], $form_values['description']);
drupal_set_message(t('Your list has been saved.'));
}
But it inserts only empty values to database table and throw no errors..
Regards,
Ktt
</pre>
</div>
</blockquote>
</body>
</html>