Hi all,🙂🙂
I am creating six level of categories using selection box link ebay category model.Right now i manged to create two level of categories.But when i tried to use same logic with third one,When user select another category form sub category selection box I have managed to passing value throw url using javascript function.
But i am getting that value using get method in .php file and i get that sub categories from db and display in .tpl file.But thing is when i am doing this the page is refreshing and I lost the previously selected categories.I used sessions also but now working.
Please explain me how can i get values without refreshing page.Here is the code...
[B]
<table cellspacing="5" cellpadding="2" border="0" width="100%">
<tr valign="top" bgcolor="#ffffff">
<td align="middle" width="50%"><table id="table_0" cellspacing="5" border="0" width="100%">
<tr>
<td><select size="10" id=chtext name=channel onchange="SelectSubCat();" style="width: 100%; ">
<option value="">Category</option>
<!-- {insert name=list_channel_ordered assign=chinfo vid=$VID}
{section name=i loop=$chinfo }
<OPTION value={$chinfo[i].id}> {$chinfo[i].ch} </OPTION>
{/section} -->
{$ch_checkbox}
</select></td>
</tr>
</table></td>
<td align=middle width="50%"><table id=table_1 cellspacing=5 border=0 width=100%>
<tr>
<td><select id="SubCat" name=schannel style="width: 100%; " size="10" onChange="nav()" >
<option value="">Subcategory</option>
</select></td>
</tr>
</table></td>
</tr>
<tr valign=top bgcolor=#ffffff>
<td align=middle><table id=table_2 cellspacing=5 border=0 width=100%>
<tr>
<td><select class="contentfont" id="selector_2" onchange="populate(2)" size="7" name="selector_2" style="width: 100%; ">
<option value=""></option>
</select></td>
</tr>
</table></td>
<td align=middle><table id=table_3 cellspacing=5 border=0 width=100%>
<tr>
<td><select class="contentfont" id="selector_3"
onchange="populate(3)" size="7" name="selector_3" style="width: 100%; ">
<option value=""></option>
</select></td>
</tr>
</table></td>
</tr>
<tr valign=top bgcolor=#ffffff>
<td align=middle><table id=table_4 cellspacing=5 border=0 width=100%>
<tr>
<td><select class="contentfont" id="selector_4" onchange="populate(4)" size="7" name="selector_4" style="width: 100%; ">
<option value=""></option>
</select></td>
</tr>
</table></td>
<td align=middle><table id=table_5 cellspacing=5 border=0 width=100%>
<tr>
<td><select class="contentfont" id="selector_5"
onchange="populate(5)" size="7" name="selector_5" style="width: 100%; ">
<option value=""></option>
</select></td>
</tr>
</table></td>
</tr>
</table>
[QUOTE]
$selsubcarfunc="function SelectSubCat(){
var cat=document.getElementById('chtext');
var sub=document.getElementById('SubCat');
removeAllOptions(sub);
";
// now select catids from sbtomb!!
$ii=0;$iii=0;
for($ii=0;isset($ch[$ii]['id']);$ii++){
$ifekk=$ifekk." if (cat.value=='".$ch[$ii]['id']."'){ ";
for($iii=0;isset($sctomb[$iii]['catid']);$iii++){
if($sctomb[$iii]['catid']==$ch[$ii]['id']){
if($sctomb[$iii]['SCHID']==$origschid)
{$ifekk=$ifekk."addOption(sub,'".$sctomb[$iii]['SCHID']."' , '".str_replace("'","\'",$sctomb[$iii]['name'])."',1);
";}
else{$ifekk=$ifekk."addOption(sub,'".$sctomb[$iii]['SCHID']."' , '".str_replace("'","\'",$sctomb[$iii]['name'])."',0);
";
}
} }
$ifekk=$ifekk." }";
}
$ifekk=$ifekk." }";
$selsubcarfunc=$selsubcarfunc.$ifekk;
STemplate::assign('selsubcarfunc', $selsubcarfunc);
}[/QUOTE]
thanks in advance.
Rameshvishnu.
[/B][FONT="Georgia"][/FONT]