populating a drop down list

4 posts by 2 authors in: Forums > CMS Builder
Last Post: February 29, 2008   (RSS)

By Chris_t - February 28, 2008

Hey Dave, well now that I have the categories list working I am feeling pretty cocky.

Let see if I can do this, the clients wants a drop down list of all the business that are listed in the coupon menu so we have a title field in the coupon menu with there name and we need to link it to there couponPage.php any thoughts would be great.

I came into work today sick and not wanting to work but after getting the menu to work so fast I feel a whole lot better [:)] Thanks Dave.

Re: [ChrisTitchenal] populating a drop down list

By Dave - February 28, 2008

The first step is always to figure out what kind of output you need. I'm thinking you want something like this:

<form method="get" action="couponPage.php">
<select name="title">
<option>Business Name Here</option>
<option>Business Name Here</option>
<option>Business Name Here</option>
</select>
</form>


The simplest would probably just be another list viewer that outputs just business names.

Just hardcode the options to list everything (per page = 1, pagenum = 1, where = 1, etc) and develop it on a separate page with nothing else before cutting and pasting it over. It will go a lot faster that way.

Would that work for you? See how far you can get and then post the code (and an url to the test viewer for it) and I'll help you out if you get stuck on anything.
Dave Edis - Senior Developer
interactivetools.com

Re: [ChrisTitchenal] populating a drop down list

By Dave - February 29, 2008

Glad to hear it's working now!

>1. can I set it to display all listings on one page
>instead of telling it a number per page.

Just set the perPage to a high number, pageNum to 1, and remove the prev/next buttons. So you're options for those might look like this:

$options['perPage'] = '100000';
$options['pageNum'] = '1';


Would that work for what you need?
Dave Edis - Senior Developer
interactivetools.com