Git Product home page Git Product logo

evandrogdn / js-dataform Goto Github PK

View Code? Open in Web Editor NEW

This project forked from marcusyoda/js-dataform

0.0 0.0 0.0 42 KB

Adds javascript support to compose object by deep form structure. The method dataform() uses javascript to serializes a form into a JavaScript Object. With this library you can also specific types to mutate data, appending the type with a colon.

License: MIT License

JavaScript 100.00%

js-dataform's Introduction

js-dataform

Adds javascript support to compose object by deep form structure. The method dataform() uses javascript to serializes a form into a JavaScript Object. With this library you can also specific types to mutate data, appending the type with a colon.

License

WHO SHOULD USE:

Recommended for all those who want to collect and structure data from an HTML form.

GETTING STARTED:

You need to include in HTML file! Use script with CDN src:

//include lib
<script type="text/javascript" src="//cdn.jsdelivr.net/gh/maviniciuus/dist/jsdataform.min.js"></script>

Your javascript code look likes this:

<script>
//get form by id
var my_form = document.getElementById('my_form');

//function to handle submit and get form data to print at console
function handle_submit(event) {
  var myform_data = dataform.parse(event.target);

  //@TODO make awesome things with form data
  console.log(myform_data);
}

// add listener to handle form submit event
document.getElementById("my_form").addEventListener("submit", handle_submit);
</script>

DOC:

Everything you need to know about dataform you find HERE. Something is missing? Open an issue right now...

LOOKING FOR SAMPLES:

Clone de repo and look samples folder. I did two samples, basic_html and bootstrap;

DEPENDENDENCIES:

  • Proudly, with 3Kb, running with no dependencies.

LICENSE:

Developed by Marcus Vinícius Mendes Gonçalves, during javascript research and study.

js-dataform's People

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.