HTML_QuickForm - select & loadQuery()

From: Date: Tue, 09 Aug 2005 15:51:18 +0000
Subject: HTML_QuickForm - select & loadQuery()
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-20338@lists.php.net to get a copy of this message
Hi, I have the following scenario (and problems): I have: 1 array with 20 records named 'Regioni'; 1 MySQL table with 103 records named 'Province' and 1 MySQL table with 8101 records named 'Comuni'. In the form there are 3 select elements: 'Regioni', 'Province' and 'Comuni'. I build the first select 'Regioni' (the root) in this way: $iscr_form->addElement('select', 'regione', 'Regione: ', $regioni, array("class"=>"loginform")); where $regioni is the array 'Regioni'. It works fine. When the page is loaded, the first select 'Regioni' is populated with the array 'Regioni' and the other two select are empty. When an option from the first select 'Regioni' is selected, i would like to populate the second select 'Province' with the results of a query on DB table 'Province'. When an option from the second select 'Province' is selected, i would like to populate the third select 'Comuni' with the results of a query on DB table 'Comuni'. The array 'Regioni' and the two MySQL tables are linked with a keys (to perform the queries). If I select another option in the first select, the second will be populated with the results of the new query and the third will be empty. I know how to do it with the usual PHP/MySQL programming, but I have not idea about to do with Quikform. Someone can help me? Thanks PS. Sorry for my english. ------------------------------------------- Akensoft Stefano Tulini Titolare e Responsabile tecnico Via della Goletta 50 I-56121 Pisa PI Tel.: 050 40361 (Studio)
        338 4344383 (cellulare)
E-Mail: stefano@akensoft.it -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.338 / Virus Database: 267.10.4/66 - Release Date: 09/08/2005

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