An open API service indexing awesome lists of open source software.

https://github.com/vednig/forms.js

Vanilla JS Library to Create Forms Dynamically
https://github.com/vednig/forms.js

bootstrap bootstrap4 dynamic-forms form form-validation forms google js

Last synced: 3 months ago
JSON representation

Vanilla JS Library to Create Forms Dynamically

Awesome Lists containing this project

README

        

# forms.js
Open Sourced JS to Create Forms Dynamically.
Object Mapped
Create Dynamic Forms Like these:

## **Building Sample Mail Subscribe Form with forms.js**


  • include 'bootstrap'

  • include 'forms.js'

    ```html

    div=document.getElementById('dataform')
    myform=formcreate(div,'GET','forms.js','uk',{'class':'red'})
    console.log(myform)
    label=formadd(myform,'label','y',{class:'container text-primary',value:'Go'},'Subscribe to Email')
    email=formadd(myform,'input','z',{class:'form form-control',placeholder:'Email-Address'})

    ```


## **Functions**
`formcreate` - creates form component

- div - provide DIV to add form to.

- form_type - `POST`/`GET`

- id - Id of New Element

- props - define props of element

- innerHTML - inside of element (can be label or div )


`formadd` - adds a component to formcreate object.

- div - provide formcreate instance

- element_type - `INPUT`/`BUTTON`/`LABEL`

- id - Id of New Element

- props - define props of element

- innerHTML - inside of element (can be label or div )