Hi all, could anyone advise me how to customise drop down list values, so the drop down values are generated/displayed in multiples of six.
Values Example: [6,12,18,24] etc.
Thanks in advance for your help and advice.
Hi all, could anyone advise me how to customise drop down list values, so the drop down values are generated/displayed in multiples of six.
Values Example: [6,12,18,24] etc.
Thanks in advance for your help and advice.
You need a function to create such array of values, like this:
function fillDropdown(numberOfItems, multiplier) {
let arrayDropdown = []
for (let i = 0; i < numberOfItems; i++) {
arrayDropdown.push({ value: i * multiplier, label: i * multiplier })
}
return arrayDropdown
}