Re: HTML_Quickform not working with two hierselects,

From: Date: Thu, 08 Mar 2007 12:39:58 +0000
Subject: Re: HTML_Quickform not working with two hierselects,
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-26785@lists.php.net to get a copy of this message
Bertrand: after seeing your message I updated to the last version but it is still not working. But now it comes the best part, are you ready...? Ok, I was trying to code an example to show the mistake, so I declare the next two elements: // first select $select1[0] = ''; $select1[1] = 'Classical'; $select1[2] = 'Funeral doom'; // second select $select2[0][0] = ''; $select2[1][0] = 'Wagner'; $select2[1][1] = 'Strauss'; $select2[2][0] = 'Pantheist'; $select2[2][1] = 'Skepticism'; // third select $select3[0] = 'Madrid'; $select3[1] = 'Barcelona'; $select3[2] = 'Almeria'; // fourth select $select4[0][0] = 'Madrid'; $select4[0][1] = 'Villanueva'; $select4[1][0] = 'Sitges'; $select4[1][1] = 'Matadepera'; $select4[2][0] = 'Roquetas'; $select4[2][1] = 'Mojacar'; $sel =& $this->addElement('hierselect', 'cds', 'Choose CD:'); $sel->setOptions(array($select1, $select2)); $sel2 =& $this->addElement('hierselect', 'cities', 'Choose city:'); $sel2->setOptions(array($select3, $select4)); And that was working ok, so I presumed my arrays were wrong, but here it comes the big surprise, instead of the this code, if I declare $sel2 before $sel, it doesn´t work, only one of them. Why? I discovered I must declare in the php in the same order as they are shown in the HTML code. Weird, isn´t it? I did the same with my problematic hierselects and now they work ok together. Any ideas?. Is a bug? Is this the normal behaviour? Thanks again // third select $select3[0] = 'Madrid'; $select3[1] = 'Barcelona'; $select3[2] = 'Almeria'; // fourth select $select4[0][0] = 'Madrid'; $select4[0][1] = 'Villanueva'; $select4[1][0] = 'Sitges'; $select4[1][1] = 'Matadepera'; $select4[2][0] = 'Roquetas'; $select4[2][1] = 'Mojacar'; --------------------------------- LLama Gratis a cualquier PC del Mundo. Llamadas a fijos y móviles desde 1 céntimo por minuto. http://es.voice.yahoo.com

« previous php.pear.general (#26785) next »