[development] Disapearing $form_values
Steven Jones
steven.jones at computerminds.co.uk
Fri Feb 12 15:40:57 UTC 2010
Hello ktt,
Please see: http://drupal.org/support for your support options.
Regards
Steven Jones
ComputerMinds ltd - Perfect Drupal Websites
Phone : 024 7666 7277
Mobile : 07702 131 576
Twitter : darthsteven
http://www.computerminds.co.uk
On 12 February 2010 15:36, ktt <kestutis98 at yahoo.com> wrote:
> 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
>
>
>
>
More information about the development
mailing list