Probably because the numeric cast of a string is 0. Try this: if (!$form_values['dati']['ecomm'] ) $ecomm2 = 0; else $ecomm2 = 1; or this: if ($form_values['dati']['ecomm'] === 0) $ecomm2 = 0; else $ecomm2 = 1; -----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Davide Michel 'ZioBudda' Morelli Sent: Sunday, February 24, 2008 4:19 PM To: support@drupal.org Subject: [support] strange value from form or bug ? Hi all. I have created a form with this select: $form['dati'] = array ( '#title' => 'Dati', '#type' => 'checkboxes', '#description' => 'Settagi per il livello', '#options' => array('ecomm' => 'Visibile Ecomm','visibile' => 'Visibile altri form','default' => 'Default') ); I have this _submit fom(): function add_lU_form_submit($form,$form_values) { if ($form_values['dati']['ecomm'] == 0) $ecomm2 = 0; else $ecomm2 = 1; if ($form_values['dati']['visibile'] == 0) $visibile = 0; else $visibile = 1; var_dump($ecomm2); var_dump($visibile); exit; //Test stop here; [....] } So, In the output form I check the Ecomm field so $form_values['dati'] is : array(3) { ["ecomm"]=> string(5) "ecomm" ["visibile"]=> int(0) ["default"]=> int(0) } Now: why this piece of function (say above) give always 0 : if ($form_values['dati']['ecomm'] == 0) $ecomm2 = 0; else $ecomm2 = 1; I don't' understand why. Tnx. -- Michel 'ZioBudda' Morelli michel@ziobudda.net Consulenza sistemistica in ambito OpenSource. Sviluppo applicazioni web dinamiche (LAMP+Ajax) Telefono: 0200619074 Telefono Cell: +39-3939890025 -- Fax: +39-0291390660 http://www.ziobudda.net ICQ: 58351764 http://www.ziobuddalabs.it Skype: zio_budda http://www.ajaxblog.it MSN: michel@ziobuddalabs.it JABBER: michel@gmail.com -- [ Drupal support list | http://lists.drupal.org/ ]