i have created custom module magento admin.there form have 2 drop-downs(one category , second subcategory).how can relate theme.i want sub categories in second drop-down on change of first dropdown(state,city like).how can in magento using jquery/ajax.
here giving idea how sub category list ajax call. should have try self call ajax on change event of main category list , below code generate sub category list.
<select id="category" class="myinput-text required-entry widthinput" name="category"> <?php $parentid=5; // parent id want sub category $categories=explode(',',mage::getmodel('catalog/category')->load($parentid)->getchildren()); foreach($categories $cat){ $category=mage::getmodel('catalog/category')->load($cat); ?> <option value="<?php echo $category->getid();?>"><?php echo $category->getname();?></option> <?php } ?> </select> hope sure you.
Comments
Post a Comment