[support] strange value from form or bug ?

Davide Michel 'ZioBudda' Morelli michel at ziobudda.net
Mon Feb 25 00:18:33 UTC 2008


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 at 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 at ziobuddalabs.it                   
						JABBER: michel at gmail.com



More information about the support mailing list