Skip to content

Files

Latest commit

b978a08 · Apr 21, 2021

History

History
53 lines (50 loc) · 2.2 KB

index.md

File metadata and controls

53 lines (50 loc) · 2.2 KB
title layout section
Home
default
home

JavaScript Powered Forms by Form.io

This library is a plain JavaScript form renderer and SDK for Form.io. This allows you to render the JSON schema forms produced by Form.io and render those within your application using plain JavaScript, as well as provides an interface SDK to communicate to the Form.io API's. The benefits of this library include.

  • Plain JavaScript implementation using ES6 and Modern practices (no jQuery, Angular, React, or any other framework dependency)
  • Renders a JSON schema as a webform and hooks up that form to the Form.io API's
  • Nested components, layouts, Date/Time, Select, Input Masks, and many more included features
  • Full JavaScript API SDK library on top of Form.io

Simple Example

<html>
  <head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdn.form.io/formiojs/formio.full.min.css">
    <script src="https://cdn.form.io/formiojs/formio.full.min.js"></script>
    <script type="text/javascript">
      window.onload = function() {
        Formio.icons = 'fontawesome';
        Formio.createForm(document.getElementById('formio'), 'https://examples.form.io/example');
      };
    </script>
  </head>
  <body>
    <div id="formio"></div>
  </body>
</html>

Result

<script type="text/javascript"> window.onload = function() { Formio.createForm(document.getElementById('formio'), 'https://examples.form.io/example'); }; </script>

JSFiddle

To play around with this renderer, we recommend using JSFiddle. Here is an example you can fork and use as a sandbox.

<script async src="//jsfiddle.net/travistidwell/v38du9y1/3/embed/"></script>