Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Multiple custom fields only showing one result
This topic contains 4 replies, has 2 voices, and was last updated by samgardiner 1 year, 1 month ago.
- AuthorPosts
- February 17, 2022 at 2:05 pm #36791
The website is an Art competition and you can submit as many entries as you like via a form which then maps the fields into a CPT named Artwork
On the front end you can search the custom fields, Name, Artwork, category etc in dropdowns.
The issue is for example, a girl named Violet Bentley has 4 entries/posts in the Artwork CPT but when you search her name, only one entry appears instead of all 4.
The values are being brought into the dropdown with the get_values variable.
The site is live but I’ve given you dev site details
Thanks
Attachments:
You must be logged in to view attached files.February 17, 2022 at 5:18 pm #36803Hi!
Thank you for the details, it helps a lot!
I am not entirely sure, but there seems to be an empty space after the name in the following post: https://australia-ain.eblue-hosting.co.uk/wp-admin/post.php?post=803&action=edit
Best,
Looks like that is applied to the filter, and only this item is returned. Can you try removing the space character after the “Violet Bentley” name (and then reloading the search on the front-end), to see if that helps?
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
February 17, 2022 at 5:38 pm #36804Yes that worked! You’re a genius.
Going forward, I’m presuming that the space is the result of autocomplete when they fill out the form.
I think this should solve the issue going forward. Thank you very much, life saver.
$(‘form’).on(‘blur’, ‘input[type=”text”], textarea’, function() {
$(this).val((i, value) => value.trim());
});February 17, 2022 at 5:52 pm #36805Sorry, I tried adding the class of the span to it but it hasn’t worked.
$(‘form’).on(‘blur’, ‘input[type=”text”], textarea, .asp_select2-selection__rendered’, function() {
$(this).val((i, value) => value.trim());What am I missing?
February 17, 2022 at 7:14 pm #36807Ignore the last question.. Thanks
- AuthorPosts
You must be logged in to reply to this topic.