populating a drop down list

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

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: [Dave] populating a drop down list

By Chris_t - February 29, 2008 - edited: February 29, 2008

Thanks Dave, I have the list being populated and built now just 2 questions.

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

2. The search is going to the page view not list view and doing it by title is not working would num work for this.


<form method="get" action="couponPage.php">
<select name="">
<?php foreach ($listRows as $record): ?>
<option value="<?php echo $record['title'] ?>-<?php echo $record['num'] ?>"> <?php echo $record['title'] ?> </option>
<?php endforeach ?>
</select> <input type="submit" value="Search"> </form>





I can get really close but the link it makes says

http://clikquikcoupons.com/proof/couponPage.php?=AAMCO-2
when it should read
http://clikquikcoupons.com/proof/couponsPage.php?AAMCO-2/

any ideas



Edit found the problem was a typo ugh but my first questions still stands how can I make sure all listings will always be displayed
Thanks Dave you and your php skills rock

Chirs

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