New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@dzeio/form-manager

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dzeio/form-manager

A powerfull Form Manager

  • 0.3.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Form Manager

A powerfull Manager for all your forms

Table of Content

  • Form Manager

Installation

nothing difficult

yarn add @dzeio/form-manager
or
npm install @dzeio/form-manager

usage

Typescript

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

const fm = new FormManager(docuement.getElementById("form"));

// add modules
import { FMRepeatAssignment } from '@dzeio/FormManager/modules/FMRepeatInput'

fm.assign(FMRepeatAssignment)

// or

import FMDateInput from '../FormManagerGit/modules/FMDateInput'
fm.assign({
    input: FMDateInput,
    type: "date",
    tagName: "input"
});

// After adding modules run to reffect modules to inputs
fm.setupInputs();

// verify form validity:
fm.verify(); //return true if valid else return false
// if it returns false you can use the variable under to see th FMInput that isnt valid
fm.lastErroredInput

// submit your data to an endpoint
fm.submit("/api/idk", (ev) => {/* onloaded callback*/}, /* verify datas beforehand default:true*/ true)

// get the json of your form
fm.getJSON()

// fill form from URI (datas MUST be in JSON (see getJSON for examples))
fm.fillFromURI("uri")

// same as before but you give the json from ts
fm.fillFromJSON(json)

// change if you only see the form or edit them
fm.setMode(FMMode.ViewMode or FMMode.EditMode)

// same thing as before but just for one field
fm.setModeForInput(FMMode.ViewMode or FMMode.EditMode, "inputName")

// Reset the form to it's defaults values
fm.clear()

Modules & Attributes

Modules

Module nameDescription
DatalistManage the datalist better than ever !
DateManage the date element
FileManage single file uploads
RepeatMake your fields repeatable !
SelectFix your Select

Attributes

Attribute nameDescription
data-autosetUpdate your value in near realtime
data-defaulta better value than value
data-ignorei don't see this
data-regexregex your value

Issues

Complete listing here

Changelog

here

Keywords

FAQs

Package last updated on 02 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc