For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > February 2006 > Quickform having strange behaviours









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Quickform having strange behaviours
lorim

2006-02-27, 7:00 pm

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('advcheckb
ox',$nome[$counter],'',$valore,null,$chi
ave);
$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.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com