Hi all,
I'm having an issue when setting a multi-choice fields with selected options via JavaScript on page load. The issue occurs due to the choice control (multi-select) sometimes being a little on the slow side on page load and therefore my JavaScript is being called before the control has completed loading 🙄 I currently have it in a document.ready, but that doesn't seem to help too much. I could create a js interval to poll/hit the page for it appearing in the DOM but sounds a little rough. There must be a nice way?
Cheers,
$(document).ready(function () {
if(PortalHelper.setMultiChoiceValues("gw_categories", [122880000,122880001])) {
$(".log").append("setChoiceValues: OK<br/>");
}
});