Coder Social home page Coder Social logo

signups-lib's Introduction

Signups JQuery Library

This is a small JQuery library built for interacting with the Signups API, but also generate forms in general.

Basic setup

The form element will be generated for you, so apply it to a wrapper.

$("#formWrapper").signupForm("form.json");

JSON Schema

Main Object:

{
  "form": {},
  "fields": []
}
Attribute Use
form Store attributes and data related to the form-element here
fields[] Store each field in the form here

Example Form Object:

{
  "form": {
    "attributes": {
      "action": "/",
      "autocomplete": "on",
      "enctype": "text/plain",
      "method": "GET",
      "name": "form",
      "novalidate": "true"
    }
  }
}
Attribute Use
action Form action, where you want to send the data
autocomplete (HTML5) If autocompleteion will be turned on for the form
enctype Form encoding, usualy application/json or application/x-www-form-urlencoded
method Form method, usualy GET/POST
name Form name
novalidate Skip validation of the form

Example Fields Array

"fields": [
  {
    "element": "input",
    "label": "Label for input",
    "attributes": {
      "type": "text",
      "value": "Default Value",
      "autocomplete": "on",
      "min": "1",
      "max": "9",
      "pattern": "^hey",
      "placeholder": "Default placeholder",
      "required": "true",
      "step": "false",
      "class": "default-class",
      "name": "defaultName"
    },
    "grid": {
      "size": 50
    }
  },
  {
    "element": "select",
    "label": "This is a select",
    "attributes": {
      "class": "defaultSelect"
    },
    "options": [
      {
        "value": "One",
        "label": "Uno",
        "select": "false"
      },
      {
        "value": "Two",
        "label": "Dos",
        "select": "true"
      }
    ]
  },
  {
    "element": "datepicker",
    "label": "Your age",
    "attributes": {
      "class": "datepicker-class" // Will be applied after the default datepicker class
    },
    "settings": {
      // Datepicker plugin settings
    }
  }
]
Element Use
input A regular input-element with a type of your choice.
select A regular select with the options of your liking

signups-lib's People

Contributors

ghostops avatar

Watchers

James Cloos avatar  avatar

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.