View Single Post
  #7  
Old 01-09-2009, 07:49 AM
 
AMMoyer AMMoyer is offline
 

Senior Member
  
Join Date: Nov 2008
Posts: 150
 

Default Re: Retaining selected Item in dropdown menu

Thank you Victor D!! I changed

$smarty->assign("yearid", $yearid);
to
$smarty->assign("year", $yearid);
but this does not help with the code below.

Now here is my tpl file that I'm trying to work with the {foreach} statement and it only shows "Array" for all choices in the combo box. I am obviously missing something.

Code:
{capture name=menu} <form method="post" action="mmy.php" name="mmysearchform"> <select name="year" style="width: 90%;"onchange="javascript:document.mmysearchform.submit ();"> <option value="" selected="selected">Select Year</option> {foreach from=$yearid item=y} <option value="{$yearid}"{if $y eq $yearid} selected="selected"{/if}>{$yearid}</option> {/foreach} {html_options name=make values=$makeid output=$makename style="width: 90%;" onchange="javascript:document.mmysearchform.submit ();"}<br> {html_options name=model values=$modelid output=$modelname style="width: 90%;"}<br> <div id="mmy" align="center"> <input name="getparts" type="submit" value="Get Parts" /> </div> </form> {/capture} { include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_mmy_search menu_content=$smarty.capture.menu cellpadding=$fc_cellpadding}
__________________
Adam
X-Cart Gold 4.4.5 - Live
X-Cart Gold 4.1.11 - Retired
X-Payments 1.0.4
CDSEO Pro
EWD Hosting
Reply With Quote