Loading ...
Sorry, an error occurred while loading the content.

Convert a multiple select to a simple select ...

Expand Messages
  • aterrade
    I got this select field. It works fine. : ) // Id Familia Equipament // Load options from oracle data base // Example valors2 -
    Message 1 of 1 , May 19, 2006
    View Source
    • 0 Attachment

      I  got this select field. It works fine. : )

        //  Id Familia Equipament
        // Load options from oracle data base       

      // Example    valors2 -> {futballshoes->234,basketshoes->231,rugbyshoes->235}
               
           $select = "select id_familia_equipament,nom from ge_families_equipaments" ;
               if (Query($conexio,$resultat,$select))
                {
                    if ($resultat["NumRows"] > 0)  
                    {         
                               for ($i=0; $i<$resultat["NumRows"]; $i++)   
                                {    
                                     if (isset($valors2))
                                     {       
                                        $valors2[$resultat["Result"]["ID_FAMILIA_EQUIPAMENT"][$i]] = $resultat["Result"]["NOM"][$i];       
                                     }  
                                     else
                                     {
                                        $valors2= array($resultat["Result"]["ID_FAMILIA_EQUIPAMENT"][$i]=>$resultat["Result"]["NOM"][$i]);
                                     }    
                                }
                    } 
                } 
                   
                
        $subscription->AddInput(array(
        "TYPE"=>"select",
         "MULTIPLE"=>1,  
        "NAME"=>"e_id_familia_equipament",
        "ID"=>"e_id_familia_equipament",
        "SELECTED"=>array($resultat["Result"]["ID_FAMILIA_EQUIPAMENT"][0]),
        "SIZE"=>3,
        "OPTIONS"=>$valors2,
        "LABEL"=>"<u>F</u>amilia Equpaments",
        "ACCESSKEY"=>"F"
       )); 
       

      Now i decide to make that the field don´t allow multiple....

      ...

         $subscription->AddInput(array(
        "TYPE"=>"select",
          "NAME"=>"e_id_familia_equipament",
        "ID"=>"e_id_familia_equipament",
        "VALUE"=>array($resultat["Result"]["ID_FAMILIA_EQUIPAMENT"][0]),
        "SIZE"=>3,
        "OPTIONS"=>$valors2,
        "LABEL"=>"<u>F</u>amilia Equpaments",
        "ACCESSKEY"=>"F"
       )); 

      It doesn´t works... : (  Some suggestions?

       

       

       

    Your message has been successfully submitted and would be delivered to recipients shortly.