While working on pdf forms on formio portal. While exploring, I came across the data source component and found out an interesting feature – Trigger on form init
.
A crucial usecase of this trigger is – When form.io pdf form loads in edit mode, form.io’s framework handles pre-population of submitted data. And the js written in the data-source component gets executed after data pre-populations is finished.
Now here is my scenario –
- I m using a hidden field instead of data source for some reason.
- For this hidden fields there is some associated js code that needs to be executed only when formio pdf form is opened in edit mode.
- The complicated part is this js must be executed after formio has handled pre-population for submitted form’s data, when loading form in edit mode.
- I figured out that this feature of formio data source components –
Trigger on form init
serves the purpose, but due to some restrictions I cannot use it.
So is there a clean way, I can implement this form.io’s Trigger on form init
functionality using vanilla js ?