Git Product home page Git Product logo

ng-formbuilder's Introduction

angular formbuilder

A simple form builder engine using angular.js and twitter bootstrap.

How does it work

It works based on json.

Install

Using bower

  bower install ng-formbuilder

don't forget to link it to your html page.

angular.module('App',['ngFormBuilder'])
.controller('AppCtrl',function($scope){
  $scope.formJson = {
    "form_name":"Form Builder",
    "fields":[{
        "type": "text",
        "label": "Text",
        "name": "text_",
        "placeholder": "Enter your text!",
        "validate": {
          "require": "false",
          "minlenght": "undefined",
          "maxlenght": "undefined"
        },
        "columnsize": 12
      }]
  };
});

In your html

<form-builder form-json="formJson"></form-builder>

Supported json formats

{
  "text": {
    "type": "text",
    "label": "Text",
    "name": "text_",
    "placeholder": "Enter your text!",
    "validate": {
      "require": "false",
      "minlenght": "undefined",
      "maxlenght": "undefined"
    },
    "columnsize": 12
  },
  "email": {
    "type": "email",
    "label": "Email",
    "name": "email_",
    "placeholder": "Enter your email",
    "validate": {
      "require": "false",
      "minlenght": "undefined",
      "maxlenght": "undefined"
    },
    "columnsize": 12
  },
  "tel": {
    "type": "tel",
    "label": "Phone",
    "name": "phone_",
    "placeholder": "Enter your phone number!",
    "validate": {
      "require": "false",
      "minlenght": "undefined",
      "maxlenght": "undefined"
    },
    "columnsize": 12
  },
  "textarea": {
    "type": "textarea",
    "label": "Textarea",
    "name": "textarea_",
    "placeholder": "Enter your details",
    "validate": {
      "require": "false",
      "minlenght": "undefined",
      "maxlenght": "undefined"
    },
    "columnsize": 12
  },
  "radio": {
    "type": "radio",
    "label": "Radio",
    "name": "radio_",
    "default": "",
    "inline": "false",
    "columnsize": 12,
    "items": [{
      "label": "Radio",
      "value": "radio"
    }]
  },
  "checkbox": {
    "type": "checkbox",
    "label": "Checkbox",
    "name": "chackbox_",
    "columnsize": 12,
    "items": [{
      "label": "Checkbox",
      "value": "checkbox"
    }]
  },
  "select": {
    "type": "select",
    "name": "select_",
    "label":"Select",
    "placeholder": "--Select--",
    "columnsize": 12,
    "items": [{
      "label": "Option 1",
      "value": "option_1"
    }]
  },
  "date": {
    "type": "date",
    "label":"Date",
    "name": "date_",
    "default": "",
    "columnsize": 12
  },
  "number": {
    "type": "number",
    "label":"Number",
    "name": "number_",
    "columnsize": 12
  },
  "time":{
    "type": "time",
    "label":"Time",
    "name": "time_",
    "default": "",
    "columnsize": 12
  },
  "color":{
    "type": "color",
    "label": "Color",
    "name": "color_",
    "placeholder": "Pick color",
    "validate": {
      "require": "false",
      "minlenght": "undefined",
      "maxlenght": "undefined"
    },
    "columnsize": 12
  },
  "datetime": {
    "type": "datetime",
    "label": "Date Time",
    "name": "dt_",
    "placeholder": "Enter Date time!",
    "validate": {
      "require": "false",
      "minlenght": "undefined",
      "maxlenght": "undefined"
    },
    "columnsize": 12
  },
  "month": {
    "type": "month",
    "label": "Month",
    "name": "month_",
    "placeholder": "Enter Month",
    "validate": {
      "require": "false",
      "minlenght": "undefined",
      "maxlenght": "undefined"
    },
    "columnsize": 12
  },
  "range": {
    "type": "range",
    "label": "Range",
    "name": "range_",
    "placeholder": "Enter Month",
    "validate": {
      "require": "false",
      "minlenght": "undefined",
      "maxlenght": "undefined"
    },
    "columnsize": 12
  },
  "week": {
    "type": "week",
    "label": "Week",
    "name": "week_",
    "placeholder": "Enter Week",
    "validate": {
      "require": "false",
      "minlenght": "undefined",
      "maxlenght": "undefined"
    },
    "columnsize": 12
  },
  "url": {
    "type": "url",
    "label": "url",
    "name": "url_",
    "placeholder": "Enter Url",
    "validate": {
      "require": "false",
      "minlenght": "undefined",
      "maxlenght": "undefined"
    },
    "columnsize": 12
  }
}

ng-formbuilder

ng-formbuilder's People

Contributors

dimpu avatar

Watchers

 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.