Skip Navigation

[Resolved] How can I have "Location" and "Distance" fields in a search form?

This support ticket is created 3 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 4 replies, has 2 voices.

Last updated by Shane 3 years, 5 months ago.

Assisted by: Shane.

Author
Posts
#2139491

I would like the search area to include a "Location" field where a user can enter an address or city and also a "Distance" field where they can enter how many miles from their location they would like to show results.

The user is basically searching for a home service company within their area.

I am unsure of how to edit the search. We need to use the classic Toolset views since we are using Beaver Builder.

#2139555

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Thank you for getting in touch.

You should be able to achieve this by following the instructions in the link below.
https://toolset.com/course-lesson/filtering-and-ordering-map-markers-by-distance/

It makes reference using the Block Builder however the principles are the same with the Classic Views.

If you run into any issues or if anything is not clear please let me know and I will be more than happy to assist.

Thanks,
Shane

#2139667

Thank you.

Is it possible to have the distance field be a dropdown? Then the user could select predefined distances like 5, 10, 25, or 50?

#2139669

Or is there a way for the distance field up/down toggle buttons to always be visible? I currently only see them when hovering over the field or changing the field's value.

#2139673

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Is it possible to have the distance field be a dropdown? Then the user could select predefined distances like 5, 10, 25, or 50?

Unfortunately no, we only have the field option for the user to manually enter the distance they want to search within.

Or is there a way for the distance field up/down toggle buttons to always be visible? I currently only see them when hovering over the field or changing the field's value.

Given that each browser interprets the number field differently then you will need to write some custom css to ensure that the arrows are visible on each browser.
Here is an example below on how this can be done in chrome.
https://stackoverflow.com/questions/25194631/is-it-possible-to-always-show-up-down-arrows-for-input-number

Thanks,
Shane