-
AuthorPosts
-
August 10, 2011 at 7:12 am #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 Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
August 10, 2011 at 7:43 am #405326Hi,
Please let’s me play around with code and respond you in a hour.
Thank you
Viet Vujooservices Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
August 10, 2011 at 7:56 am #405329I’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 VuAugust 10, 2011 at 4:26 pm #405445Hi,
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 Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
August 10, 2011 at 4:29 pm #405446Hi
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 VuAugust 11, 2011 at 6:02 am #405572Hi,
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 Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
August 11, 2011 at 6:14 am #405574Hi 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 VuAugust 11, 2011 at 6:26 am #405577PM sent. Thanks for the help.
Adam
jooservices Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
August 11, 2011 at 7:22 am #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 Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
August 12, 2011 at 12:29 am #405814Hi there.
Sorry but please also give me your site URL too 🙂
Thank you
Viet Vujakkraphong Friendjakkraphong
- Join date:
- July 2011
- Posts:
- 45
- Downloads:
- 0
- Uploads:
- 4
- Thanks:
- 3
- Thanked:
- 1 times in 1 posts
August 17, 2011 at 7:10 pm #406766hi,
how can i do the same on my site? i have 9 search fields… 😀
-
AuthorPosts
This topic contains 11 replies, has 3 voices, and was last updated by jakkraphong 13 years, 4 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum