Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • jadrake Friend
    #167239

    Hi,

    I’m using the K2 filter module to search a large database of properties. I’d like to add a “Clear Fields” button to the filter module.

    Can anyone please tell me what code is needed to accomplish this?

    I understand that the search button calls the “ja_k2filter_submit()” function. I assume the solution would be to create an additional button and have it call a “ja_k2filter_clear()” function.

    What should I put in such a function to clear all the extrafield inputs?

    Cheers,

    Adam

    jooservices Friend
    #405326

    Hi,
    Please let’s me play around with code and respond you in a hour.
    Thank you
    Viet Vu

    jooservices Friend
    #405329

    I’m here.
    If you are using default template without modify. Please try
    Open file

    modules/mod_jak2_filter/tmpl/default.php
    Line 160:
    Add this code in next line

    <input type="button" value="Clear" class="button" onclick="document.getElementById('input_searchword').value='';" />
    Thank you
    Viet Vu

    jadrake Friend
    #405445

    Hi,

    Thanks for your prompt response, however it doesn’t work correctly.

    I have 3 extrafields being used in the search:

    1) Custom words
    2) County (as a dropdown)
    3) Sleeps (as a dropdown)

    Using your modification, field 1) is cleared, but fields 2) and 3) remain.

    Can you find a way to clear all 3, please?

    Cheers,

    Adam

    jooservices Friend
    #405446

    Hi
    Sorry because i don’t have your modified module.
    You can do same by add more javascript code with 2 left extrafields.
    In case needed, please PM me with your FPT access than i can help you
    Thank you
    Viet Vu

    jadrake Friend
    #405572

    Hi,

    Thanks for the help.

    I don’t understand – I haven’t modified the module, other than adding the line you mentioned.

    The module is standard other than that. Can you offer code additions without accessing the actual site? I just need to be able to clear the extrafields.

    Thanks,

    Adam

    jooservices Friend
    #405574

    Hi there
    I’m sorry but default login should not have 2 extras fields as your module like county & sleeps.
    So, I need check your live site to find out it. Just need get element id.
    Thank you,
    Viet Vu

    jadrake Friend
    #405577

    PM sent. Thanks for the help.

    Adam

    jooservices Friend
    #405586

    <em>@jadrake 258897 wrote:</em><blockquote>PM sent. Thanks for the help.

    Adam</blockquote>

    Hi there,
    I’ve received your pm. Will check and reply you in soon.

    jooservices Friend
    #405814

    Hi there.
    Sorry but please also give me your site URL too 🙂
    Thank you
    Viet Vu

    jakkraphong Friend
    #406766

    hi,

    how can i do the same on my site? i have 9 search fields… 😀

Viewing 11 posts - 1 through 11 (of 11 total)

This topic contains 11 replies, has 3 voices, and was last updated by  jakkraphong 13 years, 3 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum