Thank you Victor!!!
One last question on this subject. The years are working great and then the Makes are loading properly, but I am having trouble getting the Make to "stick" in the dropdown box also. I'm sure there is something mis-named or there's an issue with the {if} statement, but I've been staring at it too long to find it. Thanks again.
Partial TPL code:
Code:
<select name="make" style="width: 90%;" onchange="javascript:document.mmysearchform.submit ();"{if $year == ''} disabled="disabled"{/if}>
<option value="" selected="selected">Select Make</option>
{foreach item=make from=$makes}
<option value="{$make.makeid}"{if $make.makeid == $make} selected="selected"{/if}>{$make.makename}</option>
{/foreach}
</select><br>
Partial PHP code:
Code:
$year = $_POST['year'];
if ($year){
$query2 = sprintf("SELECT DISTINCT makeid, makename FROM iemmy WHERE yearid='$year'");
$result2 = @mysql_query($query2);
while ($makerow = mysql_fetch_assoc($result2))
{
$makelist['makeid'] = $makerow['makeid'];
$makelist['makename'] = $makerow['makename'];
$makes[] = $makelist;
}
}
$smarty->assign("makes", $makes);