Skip Navigation

[Resolved] Reset button doesn't reset location field

This support ticket is created 5 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 22 replies, has 4 voices.

Last updated by davidR-12 4 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#1320471

Here: (password:Europa-808)

hidden link

1. The reset button doesnt reset the location field when 'Use my location' is used. Is there a way to have this reset or perhaps to have a second button next to it that will erase whatever is in that field?

2. There is a missing icon in the 'Use my location button'. Why is this missing?

Regards,

David

#1320819
Location.JPG

Dear David,

Thanks for the details, I have checked the URL you mentioned above, but I see different problems.
1) The reset button doesnt reset the location field when 'Use my location' is used.
I have tried to click the "Use my location" button, but get no result, the location field keeps on displaying empty, and I see there are some JS errors in your website:
Uncaught TypeError: Cannot read property 'querySelector' of null

See screenshot location.JPG
This JS error is from other plugin, since Toolset Maps plugin is based on JavaScripts, I suggest you try to fix the JS error first:
Please deactivate all other plugins, and switch to wordpress default theme 2019, deactivate all custom PHP/JS code snippets, and test again

2) The icon of Use my location button is a font-awesome icon: location-arrow:
hidden link

It seems that your website does not load fontawesome CSS files, so it conducts the problem, you might consider to use custom JS codes to remove that icon, for example:

jQuery( document ).on( 'js_event_wpv_parametric_search_results_updated', function( event, data ) {
    /**
    * data.view_unique_id (string) The View unique ID hash
    * data.layout (object) The jQuery object for the View layout wrapper
    */
         jQuery('.js-toolset-maps-distance-current-location');
});
jQuery( document ).ready( function( ) {
    /**
    * data.view_unique_id (string) The View unique ID hash
    * data.layout (object) The jQuery object for the View layout wrapper
    */
         jQuery('.js-toolset-maps-distance-current-location');
});
#1321021

Hi Luo,

1. That jQuery error is there for me. However, it is having no effect on the reset button. The geolocation works fine on Chrome, Edge, Firefox and Opera so it sounds like there is an issue with your browser.

2. I have added that code to the js section of the view and it has no effect.

Regards,

David

#1321027

Please try to modify the JS codes as below:

jQuery( document ).on( 'js_event_wpv_parametric_search_results_updated', function( event, data ) {
    /**
    * data.view_unique_id (string) The View unique ID hash
    * data.layout (object) The jQuery object for the View layout wrapper
    */
         jQuery('.js-toolset-maps-distance-current-location').val('Use My Location');
});
jQuery(document).ready(function($){
        jQuery('.js-toolset-maps-distance-current-location').val('Use My Location');
});

And test again

#1321053

Hi Luo,

Thank you that works now. In regards to point 1, any update on this?

Regards

David

#1321121

For the issue 1) same as I mentioned:
in my Chrome browser, the "Use my location" button does not work, but the reset button does work, it can reset the value insider "Enter a location" input box.

Since there are lots of JS errors in your website, the "Use my location" button and the search form depend on Javascripts, please fix those JS errors first, see my above answer:
https://toolset.com/forums/topic/reset-button-doesnt-reset-location-field/#post-1320819

#1321181

Hi Luo,

There are no js errors on this page in my browser (Chrome). I have turned off the only plugin that was causing any and without any errors displaying the reset button does not reset the field.

David

#1321765

Hi,

I have tried it again in your website, same JS errors.

Please provide a copy of your website in below private message box, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#1321901

Your transfer system doesnt work. It requests we transfer as an acceptable file transfer system (we.tl) but wont let me link you to that system.

#1321903

And now it wont let me send another link secretly. Can you set the private link up again please and I'll send it via Google. Can you also report that your system isnt allowing We Transfer even though it says it does. Note, we.tl doesn't exist as this redirects to hidden link

#1321929

I have enabled the private message box again, you can put the duplicator package into your own google drive disk, and share the link in private message box.

For the new problem: We Transfer, can we split a new ticket for it? we prefer one ticket one problem, thanks

#1321965

Thanks for the details, I have requested the access to your google drive link, please grant the access, I will check it tomorrow morning. thanks

#1321967

Access granted

#1322639

I can download the files, will update here if there is anything found.

#1322693
search.JPG

Here are what I found in your duplicator package in my localhost:
1) Deactivate all other plugins(Except) and install/switch to WordPress default theme 2019
2) Edit the the problem page "Search":
hidden link

I see the page contents are all in static HTML codes, see screenshot: search.JPG

I suggest you try these in your website:
1) Follow our document to setup the 2nd Google Map API key
https://toolset.com/documentation/user-guides/display-on-google-maps/creating-a-google-maps-api-key/#problems-with-displaying-markers-on-google-maps

2) Create a new page, put the view's shortcode into page content directly:
[wpv-view name="search-page-search"]

I have tested it in my localhost, the reset button works fine.