<?php $edit = ""; $seletedCategoryid = ""; if ($selectCategoryData) { foreach ($selectCategoryData as $categoryData) { if (isset($_REQUEST['categoryid']) && $_REQUEST['categoryid'] == $categoryData->category_id) { $edit = true; $seletedCategoryid = $_REQUEST['categoryid']; $category = $categoryData; $parentId = $categoryData->parentid; } $parent = $categoryData->parentid; $title = $categoryData->title; $category_id = $categoryData->category_id; $ele = ""; $dropDown = $selectCategory->genrateCategory($category_id, $title, $parent, $seletedCategoryid, $ele); echo $dropDown; } } ?> </select> <div class="form-group"><label><input type="checkbox" name="top" id="top" onClick="isTop(this)" /> Is top</label></div> </div> <div class="form-group"> <label for="categoryName">Category name</label> <input type="text" class="form-control" id="categoryName" name="categoryName" placeholder="Category name" value="<?php if ($edit) { echo $category->title; } ?> " required />