jump Menu from checkboxes
7 posts by 3 authors in: Forums > CMS Builder
Last Post: October 23, 2010 (RSS)
<select name="jumpMenu" id="jumpMenu" onchange="MM_jumpMenu('parent',this,0)">
<option value="#" selected="selected">Find a Store</option>
<?php foreach ($local_listingsRecords as $record): ?>
<?php if (strpos($record['subsection'], 'Animals/Pets')): ?>
<option value="http://ilovechester.accountsupport.com/shopping-animalsPets.php#<?php echo urlencode($record['title']) ?>"><?php echo $record['title'] ?></option>
<?php endif ?>
<?php if (strpos($record['subsection'], 'Antiques')): ?>
<option value="http://ilovechester.accountsupport.com/shopping-antiques.php#<?php echo urlencode($record['title']) ?>"><?php echo $record['title'] ?></option>
<?php endif ?>
<?php if (strpos($record['subsection'], 'Apparel and Accessories')): ?>
<option value="http://ilovechester.accountsupport.com/shopping-apparelAccessories.php#<?php echo urlencode($record['title']) ?>"><?php echo $record['title'] ?></option>
<?php endif ?>
<?php if (strpos($record['subsection'], 'Crafts and Gifts')): ?>
<option value="http://ilovechester.accountsupport.com/shopping-craftsGifts.php#<?php echo urlencode($record['title']) ?>"><?php echo $record['title'] ?></option>
<?php endif ?>
<?php if (strpos($record['subsection'], 'Furniture')): ?>
<option value="http://ilovechester.accountsupport.com/shopping-furniture.php#<?php echo urlencode($record['title']) ?>"><?php echo $record['title'] ?></option>
<?php endif ?>
<?php if (strpos($record['subsection'], 'Galleries')): ?>
<option value="http://ilovechester.accountsupport.com/shopping-galleries.php#<?php echo urlencode($record['title']) ?>"><?php echo $record['title'] ?></option>
<?php endif ?>
<?php if (strpos($record['subsection'], 'Home/Decor')): ?>
<option value="http://ilovechester.accountsupport.com/shopping-homeDecor.php#<?php echo urlencode($record['title']) ?>"><?php echo $record['title'] ?></option>
<?php endif ?>
<?php if (strpos($record['subsection'], 'Jewelry')): ?>
<option value="http://ilovechester.accountsupport.com/shopping-jewelry.php#<?php echo urlencode($record['title']) ?>"><?php echo $record['title'] ?></option>
<?php endif ?>
<?php endforeach ?>
</select>
Creative Director
JAM Graphics
Re: [jtedescojam] jump Menu from checkboxes
By Chris - October 20, 2010 - edited: October 22, 2010
You can use elseif to prevent more than one of your conditional blocks from running:
<select name="jumpMenu" id="jumpMenu" onchange="MM_jumpMenu('parent',this,0)">
<option value="#" selected="selected">Find a Store</option>
<?php foreach ($local_listingsRecords as $record): ?>
<?php if (strpos($record['subsection'], 'Animals/Pets')): ?>
<option value="http://ilovechester.accountsupport.com/shopping-animalsPets.php#<?php echo urlencode($record['title']) ?>"><?php echo $record['title'] ?></option>
<?php elseif (strpos($record['subsection'], 'Antiques')): ?>
<option value="http://ilovechester.accountsupport.com/shopping-antiques.php#<?php echo urlencode($record['title']) ?>"><?php echo $record['title'] ?></option>
<?php elseif (strpos($record['subsection'], 'Apparel and Accessories')): ?>
<option value="http://ilovechester.accountsupport.com/shopping-apparelAccessories.php#<?php echo urlencode($record['title']) ?>"><?php echo $record['title'] ?></option>
<?php elseif (strpos($record['subsection'], 'Crafts and Gifts')): ?>
<option value="http://ilovechester.accountsupport.com/shopping-craftsGifts.php#<?php echo urlencode($record['title']) ?>"><?php echo $record['title'] ?></option>
<?php elseif (strpos($record['subsection'], 'Furniture')): ?>
<option value="http://ilovechester.accountsupport.com/shopping-furniture.php#<?php echo urlencode($record['title']) ?>"><?php echo $record['title'] ?></option>
<?php elseif (strpos($record['subsection'], 'Galleries')): ?>
<option value="http://ilovechester.accountsupport.com/shopping-galleries.php#<?php echo urlencode($record['title']) ?>"><?php echo $record['title'] ?></option>
<?php elseif (strpos($record['subsection'], 'Home/Decor')): ?>
<option value="http://ilovechester.accountsupport.com/shopping-homeDecor.php#<?php echo urlencode($record['title']) ?>"><?php echo $record['title'] ?></option>
<?php elseif (strpos($record['subsection'], 'Jewelry')): ?>
<option value="http://ilovechester.accountsupport.com/shopping-jewelry.php#<?php echo urlencode($record['title']) ?>"><?php echo $record['title'] ?></option>
<?php endif ?>
<?php endforeach ?>
</select>
Does that help? Please let me know if you have any questions.
Chris
Re: [chris] jump Menu from checkboxes
Creative Director
JAM Graphics
Re: [jtedescojam] jump Menu from checkboxes
By Mikey - October 21, 2010
Have a look at the thread link below. I was trying to achieve something similar to what you're trying to do. Jason provided some really great support and helped me get my check boxes into a drop down menu that can be selected to jump site visitors over to the pages they are related to.
http://www.interactivetools.com/forum/gforum.cgi?post=81718;t=search_engine
Jason did a great job on this and it works like a charm.
Zick
Re: [zick] jump Menu from checkboxes
Creative Director
JAM Graphics
Re: [jtedescojam] jump Menu from checkboxes
By Chris - October 22, 2010
Oops. I wrote "else if" before, but I should have said "elseif" (with no space.) I've fixed my post above to be correct. Can you try making those changes and see if that fixes things?
Chris
Re: [chris] jump Menu from checkboxes
Creative Director
JAM Graphics