Saltar navegación

[Resuelto] Autocomplete post type custom fields

This support ticket is created hace 2 años, 9 meses. 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.

Este tema contiene 1 respuesta, tiene 2 mensajes.

Última actualización por Christopher Amirian hace 2 años, 9 meses.

Asistido por: Christopher Amirian.

Autor
Mensajes
#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?
enlace oculto

What is the link to your site?
enlace oculto

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

Idiomas: Inglés (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:

enlace oculto

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.