Form.io Lazy Load Renderer

by brendanbond

HTML

<script src="https://cdn.form.io/js/formio.embed.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
<div id="formio"></div>

JavaScript

Formio.createForm(document.getElementById('formio'), 'https://examples.form.io/w4').then(function(form) {
  /* ...my fetch code to my db */
  form.submission = {
    data: {
      a: 'My DB Data'
    }
  };
});