I hope you can help me with your support. On this screen I can select both LABELS only 1 time each and display the text of the Park label in the INPUT TEXT.
I MENTION THAT IT IS ALREADY VALIDATED SO THAT IT DOES NOT REPEAT THE SAME LABEL 2 TIMES IN THE INPUT TEXT, example "Park, Park", but when I obtain the data, that is to say the Arrangement of selected labels, if ADD THE LABEL THAT WAS SELECTED 2 TIMES "{1,1}" and should only have 1 time that value.
This is the code that I did:
function changeColor_1(x)
{
array_valores2.push(x.innerHTML);
array_ids2.push(x.id);
var txtInput = document.getElementById('node2');
var strValor = x.innerHTML;
arrDatos2.pushIfNotExist(strValor, function (e) {
return e === strValor;
});
txtInput.value = arrDatos2.toString();
}
out.println("<a class=\"btn desc fav w-button\" id=\"" + tipo.getCosa_id() + "\" name=\"parque\" onclick=\"javascript: changeColor_1(this)\" >" + tipo.getCosa_nom() + "</a>");
<input class="tf w-input" id="node2" maxlength="256" placeholder="Vida nocturna, el aeropuerto " type="text" required>
Thanks for your support!