Multiple custom fields only showing one result

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 samgardiner 2 years, 2 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #36791
    samgardiner
    samgardiner
    Participant

    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.
    #36803
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    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
    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?

    Best,
    Ernest Marcinko

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


    #36804
    samgardiner
    samgardiner
    Participant

    Yes 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());
    });

    #36805
    samgardiner
    samgardiner
    Participant

    Sorry, 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?

    #36807
    samgardiner
    samgardiner
    Participant

    Ignore the last question.. Thanks

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.