Custom Form Field Select

I have this code in a form:

 


        'Provider' => array(
            'type' => 'select',
            'name' => 'Provider',
            'caption' => _t("Provider"),
                      'values' => array (
                        '1' => 'admin', 
                        '744492318' => 'User Name',
                    ),
                      'db' => array (
                        'pass' => 'Xss', 
                    ),
        ),

 

What I would like to do is to populate the values of the select box from the Profile table. Would someone be so gracious as to tell me how to accomplish this.

Thanks

caredesign.net
Quote · 24 Aug 2013

hello again - i have been trying to still figure this out and was hoping someone would have answered by now - any assistance or guidance would be greatly appreciated. Thanks.

caredesign.net
Quote · 5 Sep 2013

First, you will need to select the records with a query as seen below : 

$aProfiles = $GLOBALS['MySQL']->getPairs("SELECT `ID` , `NickName` FROM `Profiles`", 'ID', 'NickName');


Then modify your code :

        'Provider' => array(
            'type' => 'select',
            'name' => 'Provider',
            'caption' => _t("Provider"),
        'values' => $aProfiles,
        'db' => array (
        'pass' => 'Xss',
         ),
        ),

Paypal email is jeromemingo@gmail.com - http://www.boonex.com/market/posts/modzzz
Quote · 5 Sep 2013

thanks a million - you are a life saver

caredesign.net
Quote · 5 Sep 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.