GithubHelp home page GithubHelp logo

freddy03h / jquery-serializeform Goto Github PK

View Code? Open in Web Editor NEW

This project forked from danheberden/jquery-serializeform

0.0 2.0 0.0 217 KB

jQuery plugin to serialize form elements into an object

License: GNU General Public License v2.0

JavaScript 100.00%

jquery-serializeform's Introduction

serializeForm

Make an object out of form elements

Getting Started

Download the production version or the development version.

To Use

$.fn.serializeForm makes an object out of form elements inside of the specified item.

Example:

<div id="test">
  <input name="text1" value="txt-one" />
  <input type="checkbox" name="top[child][]" value="1" checked="checked" />
  <input type="checkbox" name="top[child][]" value="2" checked="checked" />
  <input type="checkbox" name="top[child][]" value="3" checked="checked" />

  <select name="another[select]">
    <option value="opt"></option>
  </select>
</div>
$( '#test' ).serializeForm();

Returns

{ text1: "txt-one",
  top: {
    child: [ "1", "2", "3" ]
  },
  another: {
    select: "opt"
  }
}

Release History

1.1.3 Fix multiwork keyword in jquery manifest file 1.1.2 Update manifest files and erase old tags for plugin site 1.1.1 Rename to serializeForm from serializeObject 1.1.0 Support finding input elements on the jQuery collection itself and find in multiple elements 1.0.0 Actual release while moving to grunt and adding licensing information

License

Copyright (c) 2012 Dan Heberden
Licensed under the MIT, GPL licenses.

Important notes

Please don't edit files in the dist subdirectory as they are generated via grunt. You'll find source code in the src subdirectory!

While grunt can run the included unit tests via PhantomJS, this shouldn't be considered a substitute for the real thing. Please be sure to test the test/*.html unit test file(s) in actual browsers.

Installing grunt

This assumes you have node.js and npm installed already.

  1. Test that grunt is installed globally by running grunt --version at the command-line.
  2. If grunt isn't installed globally, run npm install -g grunt to install the latest version. You may need to run sudo npm install -g grunt.
  3. From the root directory of this project, run npm install to install the project's dependencies.

Installing PhantomJS

In order for the qunit task to work properly, PhantomJS must be installed and in the system PATH (if you can run "phantomjs" at the command line, this task should work).

Unfortunately, PhantomJS cannot be installed automatically via npm or grunt, so you need to install it yourself. There are a number of ways to install PhantomJS.

Note that the phantomjs executable needs to be in the system PATH for grunt to see it.

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.