On 7 Feb, 12:46, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> Try a pr($regioni) and see what you get, if it isn't something like
> array( 1 => "PIEMONTE", 2 => "..." ) then that is your problem.


in my first select I load all italian regions in my db, the controller
method in my provincia controller is

$this->set('regioni', $this->Provincia->Regione->find("all",
array("fields"=>array("Regione.idregioni","Regione.nome"),"recursive"=>0)));

so in  view

echo $form->select('Regione.idregioni', array('options'=>$regioni),
null, array('id' => 'regioni'),false);


I'd like to implement a method that in my first select I load my
regions and when I choose a region, in my second select I load the
prov. of region.

when I load my region from db the log dump of set is

Array
(
    [0] => Array
        (
            [Regione] => Array
                (
                    [idregioni] => 1
                    [nome] => PIEMONTE
                )

        )

    [1] => Array
        (
            [Regione] => Array
                (
                    [idregioni] => 2
                    [nome] => VALLE D'AOSTA
                )

        )

    [2] => Array
        (
            [Regione] => Array
                (
                    [idregioni] => 3
                    [nome] => LOMBARDIA
                )

        )

thanks !
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to