I hope you can help me with your support. In this screen I can select both LABELS only 1 time each and show the text of the Park label in the INPUT TEXT.
I MENTIONED THAT IT IS ALREADY VALIDATED SO IT DOESN'T REPEAT THE SAME LABEL TWICE IN THE INPUT TEXT, example "Park, Park", but when I obtain the data, that is, the Arrangement of selected labels, it DOES ADD THE LABEL THAT WAS SELECTED TWICE "{1,1}" and should only have it 1 times that value.
This is the code 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!
This is an example for you to step through your array and remove the "repeated" element: