Skip Navigation

[Resolved] Autocomplete post type custom fields

This support ticket is created 2 years, 7 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.

This topic contains 1 reply, has 2 voices.

Last updated by Christopher Amirian 2 years, 7 months ago.

Assisted by: Christopher Amirian.

Author
Posts
#2362639
Edit-Group-‹-Bluenext-Academy-—-WordPress.png

Tell us what you are trying to do?
Since there is no autocomplete functionality for fields, I am developing it. The result I would like to obtain is the field to auto-complete with data (static for now). I succeeded but I have a problem: the field on which I am auto-filling is within a repeatable group, I should get its id to be able to proceed with the auto-filling, obviously every time the field is duplicated it recreates a new one id and so on.

At the moment I found this solution:
I identify the id by clicking on the element and then inserted it with the autocomplete

jQuery(document).ready(function( $ ){
var arrayAutocomplete = ["A", "B", "C", "D"];

document.addEventListener('click', function(e) {
$('#'+ e.target.id ).autocomplete({
source: arrayAutocomplete
});
}, false);

});

I would like to find a way to select that specific repeatable group and apply the js on that specific field

Is there a similar example that we can see?
hidden link

What is the link to your site?
hidden link

I am attaching the repeatable group structure where I have highlighted the field on which I want to apply the autocomplete.

Thanks

#2363651

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

Please kindly consider that this is way beyond our support scope as it is a feature that is not implemented by Toolset.

The way you approached this is correct and you can use it. Another approach can be to use the FOCUS event:

hidden link

As soon as the input box s focused then you can apply the autocomplete functionality there.

We are unable to give you a final code and we only can give you an idea on how to appraoch.

Thank you for your understanding.