Page 1 of 1

Dropdown/Combo box

Posted: Fri Sep 24, 2021 7:15 am
by pekajo
Hi,
Does anyone know of a good combobox that runs from a text file and not 'hard coded' in Wysiwyg.
Thanks
Peter

Re: Dropdown/Combo box

Posted: Fri Sep 24, 2021 7:23 am
by Pablo
There is no standard solution for this, this will require a custom script.

For example (not tested, provided "AS IS"):

Code: Select all

var myArray;
var coords;
var showList;
$.ajax({
url: './contacts125.csv',
success: function(data)
{
var splitData=data.split("\n");

for (var i = 0; i < splitData.length; i++)
{
let str = splitData;
myArray = str.split(",");
showList = myArray[0] + ',' + myArray[2];

$('#Combobox1').append("<option value=\"" + showList + "\">" + showList + "</option>");
}
}
});

Re: Dropdown/Combo box

Posted: Sun Sep 26, 2021 7:36 am
by pekajo
Hi,
Thanks for the reply.
I am not up on java, are you able to give me the code at the beginning and end to make this code complete so I can just insert into my page.
I really appreciate your help.
Peter

Re: Dropdown/Combo box

Posted: Sun Sep 26, 2021 9:14 am
by Pablo
Sorry, I cannot help you with custom code. For me, it may also take a lot of time to implement a complete working solution.
I have provided the code to point you in the right direction.

Re: Dropdown/Combo box

Posted: Mon Sep 27, 2021 1:33 am
by pekajo
Cheers
Thanks anyway