Giter Club home page Giter Club logo

form-data-set's Introduction

form-data-set

dependency status

browser support

Extract form data from a hash of elements

Example

var document = require("global/document")
var console = require("console")

var FormData = require("form-data-set")

var elements = createElements()

document.body.appendChild(elements.root)

elements.root.addEventListener("change", function (ev) {
    console.log("formdata", FormData(elements))
})

// DOM Verbosity
function createElements() {
    var template = "\
        <div>\
            <div><label> Text field \
                <input class='input' />\
            </label></div>\
            <div><label> Text area \
                <textarea class='textarea'></textarea>\
            </label></div>\
            <div><label> Check box \
                <input type='checkbox' class='checkbox'></input>\
            </label></div>\
        </div>"

    var container = document.createElement("div")
    container.innerHTML = template.trim()
    var root = container.firstChild

    return {
        root: root
        , input: root.getElementsByClassName("input")[0]
        , textarea: root.getElementsByClassName("textarea")[0]
        , checkbox: root.getElementsByClassName("checkbox")[0]
    }
}

Installation

npm install form-data-set

Contributors

  • Raynos

MIT Licenced

form-data-set's People

Contributors

jonnyscholes avatar matt-esch avatar raynos avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

form-data-set's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.