dynamic form list in alphabetical/numerical order

4 posts by 2 authors in: Forums > CMS Builder
Last Post: December 20, 2010   (RSS)

By 4cdg - December 20, 2010

I have 2 list fields pulling from accounts db. I would like for them to show in alphabetical or numerical order.

the url is www.surplusprop.com/search.php

the msba region field and the listed by field.

is there any way to get these is order?

Re: [Jason] dynamic form list in alphabetical/numerical order

By 4cdg - December 20, 2010

the file is attached
Attachments:

search_005.php 18K

Re: [4cdg] dynamic form list in alphabetical/numerical order

By Jason - December 20, 2010

Hi,

You can use the function asort() right after you finish creating your regions array:

$regions = array();

foreach($accountRecords as $account){
if($account['msba_region']){
$regions[$account['msba_region']]=$account['msba_region:label'];
}
}

asort($regions);


Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/