Skip Navigation

[Resolved] Customising Search Form Using Maps Distance Filter (Q1)

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to hide the map distance filter unit dropdown that displays km and mi and also how to change the option text

Solution:
To hide that select box, please try to add following line of CSS code to your view's "Search and Pagination" section's CSS box and try to resolve your issue.:

#toolset-maps-distance { display: none !important; }

Currently there is no native feature available to change the mi option value but as a workaround you can use the following javascript code and add it to JS box and try to resolve your issue.

jQuery(document).ready(function($){
  $('#toolset-maps-distance option[value=mi]').text('Miles')
 });

Relevant Documentation:

This support ticket is created 6 years, 4 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 5 replies, has 2 voices.

Last updated by julieP 6 years, 4 months ago.

Assisted by: Minesh.

Author
Posts
#957102

How do I change the option value text mi to miles?

OR

How do I not display the distance value select field? I've tried using CSS:

select#toolset-maps-distance-value {display:none !important;}

but it's not working.

Thanks

#957185

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - as I understand you want to hide the dropdown select that displays the distance unit mi or km.

To hide that select box, please try to add following line of CSS code to your view's "Search and Pagination" section's CSS box and try to resolve your issue.:

#toolset-maps-distance { display: none !important; }
#957188

Ah thank you I can see I was targeting the wrong class!

and the other option (of changing mi to miles) ??

#957199

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - currently there is no native feature available to change the mi option value but as a workaround you can use the following javascript code and add it to JS box and try to resolve your issue.

jQuery(document).ready(function($){
  $('#toolset-maps-distance option[value=mi]').text('Miles')
 });

I'm also taking this issue as new feature request that will allow users to modify the unit option values.

#957200

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Please feel free to close this ticket 🙂

#957203

That's great Minesh - thank you!