Quickform having strange behaviours
| From: | lorim | Date: | Mon, 27 Feb 2006 15:55:17 +0000 |
| Subject: | Quickform having strange behaviours | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-23141@lists.php.net to get a copy of this message | ||
hello, i'm setting up a form with a simple text field and some advcheckboxes
with value and description taken from a db:
foreach ($descrizione as $chiave => $valore) {
$nome[$counter] = 'tipologia_'.$counter;
$prova =&
HTML_QuickForm::createElement('advcheckbox',$nome[$counter],'',$valore,null,$chiave);
$form->addElement($prova);
$tmp = $prova->getChecked();
$test[$chiave] = $tmp;
}
$_POST['test'] = $test;
maybe this is not the best code to use, but it works on my pc at home (win
xp sp1, php 5.1.2, HTML_Quickform 3.5.2-cvs) while it not works at
univerisity (linux, php 5.0.4, HTML_Quickform 3.5.2-cvs)
this is the var_dump of $descrizione ON MY PC:
array(4) {
[2]=>
string(3) "bla"
[5]=>
string(6) "cascon"
[3]=>
string(6) "fefefe"
[1]=>
string(4) "snow"
}
and this is the var_dump AT UNIVERSITY:
string(6) "asbf c"
i don't know what the problem is... i've got the same problem when
using groups... looking into HTML/QuickForm/group.php i've found
that the problem is in the onQuickFormEvent function which simply
freeze when the form is submitted, or calls wrong addElement
(in facts, it builds up a string instead of an array of objects)
any suggestion?
thanks, lorim.