Results 1 to 5 of 5

Thread: How to create a clear button using Jquery for refine search

Threaded View

  1. #1
    Senior Member
    Join Date
    Dec 2011
    Posts
    159

    How to create a clear button using Jquery for refine search

    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>
    Last edited by rosegarden; July 29, 2012 at 04:56 PM.