autocomplete
autocomplete
Is it possible to display the variable " idaliSelectionner " I recovered from the autocomplete event and put it in my field label : "ID Aliment " parameter "def" :
{
label: "Aliment :",
name: "ingesta.libali",
type: "autoComplete",
opts: {
source: "./php/autocompleteAli.php",
minLength: 3,
select : function(event, ui) { var idaliSelectionner = ui.item.id ; } },
},
{
label: "ID aliment :",
name: "ingesta.id_ali",
//def: idaliSelectionner
type: "readonly"
},
If you can help me it would be cool ! Thank you
This discussion has been closed.
Replies
Hi,
Yes, this should be quite possible using the
field().label()
method in yourselect
function. For example you might use:Allan
I wish that the variable is displayed in the input and not the field label
I'm a bit confused I'm afraid - you asked above for the selected value to be displayed in the label, which I think the above does. However, you note now that you want the value to be displayed in the input. Is it not already there?
Allan
yes sorry
the solution :
editor.field('ingesta.id_ali').set(+idaliSelectionner) ;