Skip Navigation

[Resolved] Ajax Custom Search not working

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

Problem: I am trying to use an AJAX custom search View, but every time I click the submit button the page reloads. AJAX doesn't seem to work.

Solution: There seems to be a problem with the custom theme.

This support ticket is created 5 years, 8 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 5 replies, has 2 voices.

Last updated by dorineD 5 years, 8 months ago.

Assisted by: Christian Cox.

Author
Posts
#1248263

I am trying to:
create a custom search with checkboxes and a submit button

Link to a page where the issue can be seen:
hidden link

I expected to see:
Ajax is working fine, updates when checkbox is checked and submit button clicked.

Instead, I got:
A full page refresh and updated result, so I think Ajax is blocked or not loaded on my website?

#1248523

Hi, something strange is going on with this View. If I try to edit it in wp-admin, it looks incomplete. Can you check? hidden link

#1249039

HiChristian,

thanks for checking. I think the problem is still there. AJAX is not working...
Can you check again? 🙂

hidden link

Kind regards,
Jef M.

#1250243

Looks like something in your custom theme is breaking Views' AJAX. If you switch to a default theme like Twenty Nineteen, the problem is resolved and AJAX works as expected. Maybe your custom theme is doing something with jQuery that overrides the AJAX function, or overrides another feature of the search form? I'm not really sure, and troubleshooting custom themes is outside the scope of our support policy: https://toolset.com/toolset-support-policy/

Try to narrow down exactly what the problem is in your theme, and if you need technical assistance with something specific I can try to ask for the best approach to resolve the problem.

#1250893

Hi,

thanks for your help. The solution was to add the vollowing in my templates:

 <?php wp_footer(); ?>

Normally that's something I do not forget in my custom themes, but this time I was al little too quick.

Kind regards,
Jef M.

#1250895

My issue is resolved now. Thank you!