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 class="container">
  <div id="formio"></div>
</div>

JavaScript

const formDefinition = {
  components: [{
      label: "First Name",
      tableView: true,
      key: "firstName",
      type: "textfield",
      input: true,
    },
    {
      label: "Last Name",
      tableView: true,
      key: "lastName",
      type: "textfield",
      input: true,
    },
    {
      label: "Address",
      applyMaskOn: "change",
      tableView: true,
      key: "address",
      type: "textfield",
      input: true,
    },
    {
      type: "button",
      label: "Submit",
      key: "submit",
      disableOnInvalid: true,
      input: true,
      tableView: false,
    },
  ],
  settings: {},
};
Formio.createForm(document.getElementById('formio'), formDefinition).then(function(form) {
  form.submission = {
    data: {
      firstName: "Brendan",
      lastName: "Bond",
      address: "123 Bleeker St.",
    }
  }
});