A powerfull Form Manager https://dze.io
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Florian Bouillon a0da525b6d
Updated FMRepeatInput.
6 days ago
modules Updated FMRepeatInput. 6 days ago
FMInput.ts Added functions to help set/get default value 6 days ago
FormManager.ts Added a first version of `data-autoset` 6 days ago
Interfaces.ts first commit 1 month ago
README.md Small changes 1 month ago
package.json Small changes 1 month ago



A powerfull Manager for all your forms

Table of Content


to have the basic system just import FormManager

import FormManager from '@dzeio/form-manager';

const fm = new FormManager(docuement.getElementById("formId"))

from now on you can get datas by using fm.getJSON() fill by using fm.fillFromJSON() or fm.fillFromURI() verify datas with fm.verify()


Actually there is 3 modules included in the system non of them are loaded
each modules add new functionality to the form (see later)

to load a module:

//the three modules availables
import { FMRepeatInputAssignment } from '@dzeio/form-manager/modules/FMRepeatInput'
import { FMDatalistAssignement } from '@dzeio/form-manager/modules/FMDatalistInput'
import { FMDateInputAssignement } from '@dzeio/form-manager/modules/FMDateInput'

// add the modules to the Form

// reload the manager to use the new modules

you can customise how the module assign himself to an element by doing this:

    input: typeof FMInput
    classes?: string[] | string
    attributes?: string[] | string
    type?: string
    tagName?: string
    input: FMRepeatInput,
    classes: "custom-class",
    attributes: "data-custom",
    type: "number", //for input
    tagName: "div"

datalist changes

the values for the datalist will not be the value attribute anymore but a data-value so the end user will see wht you wnt and not the value you want to send

even if you set data-strict the result value will only be set if it’s from one of the option
if not set the value will stay set by what the user wrote ATTENTION if multiple option has the same value attribute the final value will be the data-value of the first value


 <input name="listing" list="list" data-strict/>
 <datalist id="list">
     <option data-value="value submitted" value="shown value">value subtitle</option>
     <option data-value="value submitted" value="shown valuee">value subtitle</option>
     <option data-value="value submitted" value="shown valueq">value subtitle</option>
     <option data-value="value submitted" value="shown valuea">value subtitle</option>

date changes

FMDateInput change the result type from a string to a Date object
and if data-default is set the current date will be set


<input type="date" name="date" data-default />

Repeat Element

the Repeat element allow to add/delete multiple time the sames input(s)

NOTE: actually the filling don’t work but the rest work just fine


<div class="fm-repeat" name="repeat-element"> <!-- container -->
    <div class="fmr-template"> <!-- template container (won't show) -->
        <input data-input type="text"/> <!-- data-input replace the name element -->
        <!-- if there is only one input the name will be `testName[x]` with `x` being the index -->
        <!-- if there is only multiple inputs the name will be `testName[x][index]` -->
        <div class="fmr-del"> <!-- delete button container -->
    <!-- future content position -->
    <!-- EXample content from above
        <input data-input type="text"/>
        <div class="fmr-del">
    <!-- future content position -->
    <div class="fmr-add"> <!-- container for add button -->


more Listing here

  • add data-autoset to autofill the input with data from another one with readonly and disabled
  • allow filling of FMRepeatInput
  • add data-regex for verification
  • add data-ignore mainly for data-autoset