I have a need to set radio buttons using the setField() method from datalink (the jQuery plugin).
I have read the issues around this on gitHub and seen a fork to address it (https://github.com/jamiemthomas/jquery-datalink), but this is for older versions of jQuery.
What would be an easy way to update radio buttons using the datalink plugin’s setField method, perhaps with a slight modification? Maybe there are other alternatives / plugins?
Thanks to a comment from an issue logged on this (https://github.com/jquery/jquery-datalink/issues/14#issuecomment-531732), I have adapted the hack found there. By changing the setField method as follows, it works:
(EDIT – added code for setting checkbox as well).
Before:
After:
EDIT – I have also forked the original datalink project on GitHub and added these changes: https://github.com/mydoghasworms/jquery-datalink/