Skip Navigation

[Résolu] Autocomplete post type custom fields

This support ticket is created Il y a 1 an et 12 mois. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

This topic contains 1 réponse, has 2 voix.

Last updated by Christopher Amirian Il y a 1 an et 11 mois.

Assisted by: Christopher Amirian.

Auteur
Publications
#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: Anglais (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.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.