Am creating a simple custom search , where users will search using a droplist of option , i have successfully created the module , however i do not know how to show the form in frontend and how to pass values to my helper file for validation , please help ! Below is my code
model(helper.php)
public static function getdata($catid)
{
//$catid1=17;
$res=array();
$categories = JCategories::getInstance('Content');
$cat = $categories->get($catid);
$children = $cat->getChildren();
$res['FieldofStudy']=$children;
return $res;
}
View (tmpl/default.php) Which is form that shows droplist to send back to controller
<select id="Field-of-Study" class="form-control">
<?php foreach($res['FieldofStudy'] as $a){ ?>
<option>
<?php echo $a->title ; ?>
</option>
<?php } ?>
</select>