There was an interesting example given here (thanks @marcus-j-davies), showing how to create varying numbers of checkbox items when configuring a node. That thread is closed, therefore this new question.
I'd like to do something like the example that but the problem is that it requires the number of checkbox items to be known beforehand (3 in the example). However in my use case the number of items is not known beforehand and will be discovered at runtime. I can obtain the number of items and associated item data at oneditprepare in the javascript section but (based on that information) could anyone outline how to then dynamically generate the correct number of form-row entries in the html section?
That is to ask - if I find at run time that I need 4 checkbox items, how to generate 4 form-row divs; if I find I need 7 checkbox items, how to generate 7 form-row divs etc. ?
Thanks for any help,
chris