I have a CGridview with a search form above it. As part of the search form there is a clear button which should bring back all the results. At the moment it keeps the search fields although they clear from the inputs.
The code for the clear is:
<div class="clearOptions">
<a href="javascript:clearForm();">Clear options</a>
</div>
and
Yii::app()->clientScript->registerScript('clearForm', "
function clearForm() {
$(':input','#searchOptions').not(':button, :submit, :reset, :hidden').val('').removeAttr('checked').removeAttr('selected');
$.fn.yiiGridView.update('product-grid', {
data: ''
});
}
", CClientScript::POS_HEAD);
What am I missing?