Hi Support
We recently moved from Avada to Elementor Pro and since various JavaScripts to limit datepickers and the Location entry field for Toolset Maps to addresses within Germany only doesn't appear to work any longer in some Views and some Post Forms.
I don't know whether it's due to changes in the recent Toolset plugin updates, or perhaps because we're displaying the view now in the Toolset View Elementor Pro Widget?
Question: In general, is the JavaScript specified in Toolset Views expected to be executed correctly by specifying it in the Toolset View, or should it be placed in the Toolset View Widget in Elementor Pro? I would prefer to keep all the JavaScript in the original Toolset Views, if possible.
1) Views: Locations are no longer being limited to locations in Germany, as was working previously:
- Find a Job Search and Results View
- Find a Native Nanny Search and Results View
using:
jQuery(document).ready(function($){
jQuery(".js-toolset-maps-distance-center").geocomplete({country: 'DE',type: []});
});
2) "Edit" Post Forms where the JavaScript to limit Locations to German addresses no longer working:
- Post Form - Edit Nanny Ad
- Post Form - Edit Job Ad
however the same JavaScript IS working correctly on the "New" versions of the ads:
- Post Form - New Nanny Ad
- Post Form - New Job Ad
using:
var delayed = function() {
jQuery(".js-toolset-maps-address-autocomplete").each(function(index,item){
var map = jQuery(item).closest('.js-toolset-google-map-container').find('.js-toolset-google-map-preview:eq(0)');
jQuery(item).geocomplete({'country':'DE', 'type': [], 'map': map});
});
};
jQuery(document).ready(function(){
setTimeout( delayed, 2000 );
});
3) On following Post Forms, the datepicker is no longer disallowing dates from up to 18 years ago (users must be 18 to join our site, so birthdate must be minimum 18 years ago):
- Post Form - New Family User
- Post Form - New Nanny User
using:
jQuery(window).bind("load", function() {
jQuery( ".js-wpt-date" ).datepicker("option", "minDate", "-100Y").datepicker("option", "maxDate", "-18Y");;
});
Thanks and best regards
Simon