sorting a text box

3 posts by 3 authors in: Forums > CMS Builder
Last Post: October 18, 2012   (RSS)

Re: [mel] sorting a text box

Hi Mel,

I don't think that you can easily sort the words in a text box directly, but I've been proved wrong by the coding gurus at Interactive Tools before.

Is there a finite list of locations? How do the locations get entered into the text box. Are there any controls as to how that's done?

As far as trying to sort the text in a text box, you may be able to create an array out of the text using the PHP explode function http://php.net/manual/en/function.explode.php

Then you could try sorting the array alphabetically using the PHP sort function http://php.net/manual/en/function.sort.php

I think that you'd have to put together some code to make sure that your location names are in a specific format, and I don't know how you would deal with multi-word location names, but it's an approach you could explore if you think it might work.

If you need more help you could go the consulting route consulting@interactivetools.com. Consulting is usually fast and cost effective.

Best,

Jerry Kornbluth
[email]
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [mel] sorting a text box

If I were setting this up, the locations would be stored in a related records table and I would use a multi-select list to choose as many locations that apply to that record. Then on the display page, sort the related records by name.
Ron Conring
Conring Automation Services
----------------------------------------
Software for Business and Industry Since 1987