View Single Post
  #2  
Old 09-23-2010, 03:51 AM
 
Jeremy Smith Jeremy Smith is offline
 

Senior Member
  
Join Date: Jan 2009
Posts: 167
 

Default Re: HTML select option box for root and sub caregories problem

Ive finally got it:

Quote:
{* $Id: categories.tpl,v 1.26.2.4 2008/07/22 07:58:28 ferz Exp $ *}
{capture name=menu}
{if $active_modules.Fancy_Categories ne ""}
{assign var="fc_cellpadding" value="0"}
{else}
{if $config.General.root_categories eq "Y"}


{* <form name="catForm">Manufacturer:
<select name="rootCat" onChange="window.location=document.catForm.rootCat .options[document.catForm.rootCat.selectedIndex].value">



<option value="">Please select: </option>

{foreach from=$categories item=c}

<option value="home.php?cat={$c.categoryid}">{$c.category} </option>

{/foreach}

</select>

Model:

<select id="subCat" name="subCat">

<option value="#"></option>

{foreach from=$subcategories item=c key=catid}
<option value="home.php?cat={$catid}">{$c.category}</option>
{/foreach}

</select>

<input type="button" name="go" value="Select" onClick="window.location=document.catForm.subCat.o ptions[document.catForm.subCat.selectedIndex].value">

</form> *}



<form method="get" action="home.php">
Manufacturer:
<select name="cat" onchange="this.form.submit()">
<option value="0"{if $cat eq "0"} selected{/if}>Select Manufacturer...</option>
{foreach from=$categories item=c}
<option value="{$c.categoryid}"{if $cat eq $c.categoryid} selected{/if}>{$c.category}</option>
{/foreach}
</select>

Please select:
<select name="subcat" onchange="this.form.submit()">
<option value="0"{if $cat eq "0"} selected{/if}>Printers...</option>
{foreach from=$subcategories item=c key=catid}
<option value="{$catid}"{if $cat eq $catid} selected{/if}>{$c.category}</option>
{/foreach}
</select>
</form>

{else}

{/if}
{/if}
{/capture}
{ include file="menuDropDown.tpl" menu_content=$smarty.capture.menu }
</div>
<div id="printerSearchBottom"></div>

As far as I am concerned this is now closed as an issue.

Thanks,
Jeremy
__________________
Version 4.1.11 on Linux (Fedora)
X-Cart Gold
Reply With Quote