Oh duh, I totally glossed over that. Yeah in Drupal 6 form values are no longer stored in the $form_values variable and are now stored in the $form_state['values'] array<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 1:29 PM, ktt <span dir="ltr"><<a href="mailto:kestutis98@yahoo.com">kestutis98@yahoo.com</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,<br>
<br>
Sorry if the question appeared too trivial. I tried<br>
"$form_values['listname']['list_name']" before with no success. Strangely.<br>
<br>
This worked for me - with "$form_values = $form_state['values'];"<br>
<br>
function contactlistcreate_submit($form, &$form_state) {<br>
$form_values = $form_state['values'];<br>
<div class="im"> 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>
</div>Thank you for benevolent answers.<br>
<br>
Regards,<br>
Ktt<br>
--- On Fri, 2/12/10, Adam Gregory <<a href="mailto:arcaneadam@gmail.com">arcaneadam@gmail.com</a>> wrote:<br>
<br>
> From: Adam Gregory <<a href="mailto:arcaneadam@gmail.com">arcaneadam@gmail.com</a>><br>
> Subject: Re: [development] Disapearing $form_values<br>
> To: <a href="mailto:development@drupal.org">development@drupal.org</a><br>
> Date: Friday, February 12, 2010, 5:50 PM<br>
<div><div></div><div class="h5">> Really that's how we roll on the Dev<br>
> list now? "Hey thanks for coming, now get out."<br>
> Esspecially when the answer is pretty simple.<br>
><br>
> Ktt,<br>
><br>
> The reason you are not inserting values is the<br>
> '#tree' => TRUE, attribute set in your fieldset.<br>
> This means that subsequent values will retain the array tree<br>
> in $form_values. Therefore your $form_values in the<br>
> db_query should look like this,<br>
> $form_values['listname']['list_name'],<br>
> $form_values['listname']['description'].<br>
><br>
><br>
><br>
> I hope that helps.<br>
> -----<br>
> Adam A. Gregory<br>
> Drupal Developer & Consultant<br>
> Web: AdamAGregory.com<br>
> Twitter: <a href="http://twitter.com/adamgregory" target="_blank">twitter.com/adamgregory</a><br>
> Phone: 910.808.1717<br>
><br>
><br>
> Cell: 706.761.7375<br>
><br>
><br>
><br>
> On Fri, Feb 12, 2010 at 10:40 AM,<br>
> Steven Jones <<a href="mailto:steven.jones@computerminds.co.uk">steven.jones@computerminds.co.uk</a>><br>
> wrote:<br>
><br>
><br>
> Hello ktt,<br>
><br>
><br>
><br>
> Please see: <a href="http://drupal.org/support" target="_blank">http://drupal.org/support</a><br>
> for your support options.<br>
><br>
><br>
><br>
> Regards<br>
><br>
> Steven Jones<br>
><br>
> ComputerMinds ltd - Perfect Drupal Websites<br>
><br>
><br>
><br>
> Phone : 024 7666 7277<br>
><br>
> Mobile : 07702 131 576<br>
><br>
> Twitter : darthsteven<br>
><br>
> <a href="http://www.computerminds.co.uk" target="_blank">http://www.computerminds.co.uk</a><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> On 12 February 2010 15:36, ktt <<a href="mailto:kestutis98@yahoo.com">kestutis98@yahoo.com</a>><br>
> wrote:<br>
><br>
> > Hello,<br>
><br>
> ><br>
><br>
> > I have a form:<br>
><br>
> ><br>
><br>
> > function contactlistcreate() {<br>
><br>
> > $form = array();<br>
><br>
> ><br>
><br>
> > $form['listname'] = array(<br>
><br>
> > '#type' => 'fieldset',<br>
><br>
> > '#title' => t('Create new<br>
> list'),<br>
><br>
> > '#tree' => TRUE,<br>
><br>
> > );<br>
><br>
> > $form['listname']['list_name'] =<br>
> array(<br>
><br>
> > '#type' => 'textfield',<br>
><br>
> > '#title' => t('List name'),<br>
><br>
> > '#size' => 30,<br>
><br>
> > '#maxlength' => 64,<br>
><br>
> > '#description' => t('Enter the<br>
> list name'),<br>
><br>
> > '#default_value' =><br>
> 'dddodododod',<br>
><br>
> > );<br>
><br>
> > $form['listname']['description'] =<br>
> array(<br>
><br>
> > '#type' => 'textarea',<br>
><br>
> > '#title' => t('Describe it'),<br>
><br>
> > '#cols' => 60,<br>
><br>
> > '#rows' => 5,<br>
><br>
> > '#description' => t('List<br>
> description.'),<br>
><br>
> > );<br>
><br>
> > $form['listname']['submit'] =<br>
> array('#type' => 'submit',<br>
> '#value' => t('Save'));<br>
><br>
> > return $form;<br>
><br>
> > }<br>
><br>
> ><br>
><br>
> > and submit function:<br>
><br>
> ><br>
><br>
> > function contactlistcreate_submit($form_id,<br>
> $form_values) {<br>
><br>
> > db_query(<br>
><br>
> > "INSERT INTO {contactsliststable}<br>
> (contacts_list_name, contacts_list_description) VALUES<br>
> ('%s', '%s')",<br>
> $form_values['list_name'],<br>
> $form_values['description']);<br>
><br>
> > drupal_set_message(t('Your list has been<br>
> saved.'));<br>
><br>
> > }<br>
><br>
> ><br>
><br>
> > But it inserts only empty values to database table and<br>
> throw no errors..<br>
><br>
> ><br>
><br>
> ><br>
><br>
> > Regards,<br>
><br>
> > Ktt<br>
><br>
> ><br>
><br>
> ><br>
><br>
> ><br>
><br>
> ><br>
><br>
><br>
><br>
><br>
<br>
<br>
<br>
</div></div></blockquote></div><br>