I followed instructions here and I render some fields in my front end view, like this:
echo $this->filterForm->renderField('search', 'filter');
Now I wonder how to manually add a clear button.
If I render the joomla.searchtools.default, the clear button that it shows, works:
echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this));
I tried with adding this to my layout:
<div class="btn-wrapper">
<button type="button" class="btn hasTooltip js-stools-btn-clear" title="<?php echo JHtml::_('tooltipText', 'JSEARCH_FILTER_CLEAR'); ?>">
<?php echo JText::_('JSEARCH_FILTER_CLEAR');?>
</button>
</div>
The button shows but does nothing. How could I render a Clear form button in mylayout?
EDIT putting the question clearer: why this reset code does not clean the form?
<input type = "reset" value = "Reset">
but the "Clear" buton of JLayoutHelper::render('joomla.searchtools.default',...) does?