Does anyone know of a way to add options to a Fabrik form dropdown element via Javascript? Using .add on the element does not work and neither does creating a JS "option" and trying to add it.
It took some serious trial and error, but I got this working with an easier solution. Here is the dumbed down code (I am actually getting the values from a web service and adding them in a loop, but left that out for brevity):
Code:
var folders = $('ep_conference___xcheck_folders');
//this just removes and existing values if needed
while (folders.options.length > 0) {
folders.remove(folders.options.length - 1);
}
var opt = document.createElement("option");
opt.text = "testme";
opt.value = "metoo";
folders.add(opt, null);