Really that's how we roll on the Dev list now? "Hey thanks for coming, now get out." Esspecially when the answer is pretty simple.<br><br>Ktt,<br><br>The reason you are not inserting values is the '#tree' => TRUE, attribute set in your fieldset. This means that subsequent values will retain the array tree in $form_values. Therefore your $form_values in the db_query should look like this, $form_values['listname']['list_name'], $form_values['listname']['description'].<br>
<br>I hope that helps.<br clear="all">-----<br>Adam A. Gregory<br>Drupal Developer & Consultant<br>Web: AdamAGregory.com<br>Twitter: <a href="http://twitter.com/adamgregory">twitter.com/adamgregory</a><br>Phone: 910.808.1717<br>
Cell: 706.761.7375<br>
<br><br><div class="gmail_quote">On Fri, Feb 12, 2010 at 10:40 AM, Steven Jones <span dir="ltr"><<a href="mailto:steven.jones@computerminds.co.uk">steven.jones@computerminds.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hello ktt,<br>
<br>
Please see: <a href="http://drupal.org/support" target="_blank">http://drupal.org/support</a> for your support options.<br>
<br>
Regards<br>
Steven Jones<br>
ComputerMinds ltd - Perfect Drupal Websites<br>
<br>
Phone : 024 7666 7277<br>
Mobile : 07702 131 576<br>
Twitter : darthsteven<br>
<a href="http://www.computerminds.co.uk" target="_blank">http://www.computerminds.co.uk</a><br>
<br>
<br>
<br>
On 12 February 2010 15:36, ktt <<a href="mailto:kestutis98@yahoo.com">kestutis98@yahoo.com</a>> wrote:<br>
> Hello,<br>
><br>
> I have a form:<br>
><br>
> function contactlistcreate() {<br>
> $form = array();<br>
><br>
> $form['listname'] = array(<br>
> '#type' => 'fieldset',<br>
> '#title' => t('Create new list'),<br>
> '#tree' => TRUE,<br>
> );<br>
> $form['listname']['list_name'] = array(<br>
> '#type' => 'textfield',<br>
> '#title' => t('List name'),<br>
> '#size' => 30,<br>
> '#maxlength' => 64,<br>
> '#description' => t('Enter the list name'),<br>
> '#default_value' => 'dddodododod',<br>
> );<br>
> $form['listname']['description'] = array(<br>
> '#type' => 'textarea',<br>
> '#title' => t('Describe it'),<br>
> '#cols' => 60,<br>
> '#rows' => 5,<br>
> '#description' => t('List description.'),<br>
> );<br>
> $form['listname']['submit'] = array('#type' => 'submit', '#value' => t('Save'));<br>
> return $form;<br>
> }<br>
><br>
> and submit function:<br>
><br>
> function contactlistcreate_submit($form_id, $form_values) {<br>
> db_query(<br>
> "INSERT INTO {contactsliststable} (contacts_list_name, contacts_list_description) VALUES ('%s', '%s')", $form_values['list_name'], $form_values['description']);<br>
> drupal_set_message(t('Your list has been saved.'));<br>
> }<br>
><br>
> But it inserts only empty values to database table and throw no errors..<br>
><br>
><br>
> Regards,<br>
> Ktt<br>
><br>
><br>
><br>
><br>
</blockquote></div><br>