Reply To: Google Maps Javascript stops working if Ajax Search is present

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Google Maps Javascript stops working if Ajax Search is present Reply To: Google Maps Javascript stops working if Ajax Search is present

#15734

Ernest Marcinko
Keymaster

Thanks, this one works!

I may have found the problem, but I can't open files via the FTP account you sent, so I could not test a solution.

Basically there is an error within a custom code on the page within the updateView() function declaration, on this line:

checkedBoxes = ([…document.querySelectorAll('input[type=checkbox]:checked')]).map(function(o) { return o.id; });

This line means, that it maps all the checkboxes found on the page, which also includes the checkboxes within the search form, or anything at all, even invisible ones.

My suggestion to fix that would be to make the query more specific, like so:

checkedBoxes = ([…document.querySelectorAll('#options input[type=checkbox]:checked')]).map(function(o) { return o.id; });

This will make sure that the selection only affects the checkboxes which are contained by the element with the 'options' ID.

I hope this helps!

Best,
Ernest Marcinko

If you like my products, don't forget to rate them on codecanyon :)