rosegarden
July 29, 2012, 04:07 PM
I been doing this whole night and I still can't get this RESET button ... anyone?
How to create a Clear button to clear all the fields so that user can do a fresh refine search?
=========== refine_search.tpl ==================
<table>
<tr>
<td style="padding-{$text_dir_rev}: 10px;"><input class="search_field_item button" type="submit" name="search" value="{$lang.search}" /></td>
<td><input type="button" class="button" value="Clear Form" id="reset_filter_button" /></td>
</tr>
</table>
<script type="text/javascript">
{literal}
$(document).ready(function(){
$('#reset_filter_button').click(function(){
eraseCookie('listings_sc');
listingsGrid.reset();
$("#filters select option[value='']").attr('selected', true);
$("#filters input[type=text]").val('');
$("#Category_ID option").show();
});
{/literal}
</script>
How to create a Clear button to clear all the fields so that user can do a fresh refine search?
=========== refine_search.tpl ==================
<table>
<tr>
<td style="padding-{$text_dir_rev}: 10px;"><input class="search_field_item button" type="submit" name="search" value="{$lang.search}" /></td>
<td><input type="button" class="button" value="Clear Form" id="reset_filter_button" /></td>
</tr>
</table>
<script type="text/javascript">
{literal}
$(document).ready(function(){
$('#reset_filter_button').click(function(){
eraseCookie('listings_sc');
listingsGrid.reset();
$("#filters select option[value='']").attr('selected', true);
$("#filters input[type=text]").val('');
$("#Category_ID option").show();
});
{/literal}
</script>