All Projects → dstreet → Dependson

dstreet / Dependson

Licence: mit
a jQuery plugin for handling form field dependencies

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Dependson

Jeeplatform
一款企业信息化开发基础平台,拟集成OA(办公自动化)、CMS(内容管理系统)等企业系统的通用业务功能 JeePlatform项目是一款以SpringBoot为核心框架,集ORM框架Mybatis,Web层框架SpringMVC和多种开源组件框架而成的一款通用基础平台,代码已经捐赠给开源中国社区
Stars: ✭ 1,285 (+1238.54%)
Mutual labels:  jquery
Bootstrap Simple Admin Template
The most reliable HTML, CSS, and JavaScript simple admin template for developing responsive, mobile first web applications on the web.
Stars: ✭ 92 (-4.17%)
Mutual labels:  jquery
Tweetme
Build a Twitter-like web app step-by-step with Django, jQuery, and Bootstrap!
Stars: ✭ 95 (-1.04%)
Mutual labels:  jquery
Multipicker
Form styling plugin for jQuery
Stars: ✭ 90 (-6.25%)
Mutual labels:  jquery
Accrue.js
A loan and interest calculation plugin for jQuery. Create calculators that allow you to calculate interest on loans, compare multiple loans (with different interest rates), and create amortization charts.
Stars: ✭ 90 (-6.25%)
Mutual labels:  jquery
Manga Tracker
A cross-site manga-tracker.
Stars: ✭ 93 (-3.12%)
Mutual labels:  jquery
Komple Web Gelistirme Dersleri
Sıfırdan ileri seviyeye 'Web Geliştirme': Html, Css, Sass, Flexbox, Javascript, Bootstrap,JQuery,Asp.Net Mvc ve Core Mvc
Stars: ✭ 86 (-10.42%)
Mutual labels:  jquery
Bpage
Based on bootstrap style, static page jump can also be asynchronous page processing pagination plugin
Stars: ✭ 96 (+0%)
Mutual labels:  jquery
Jvectormap
Stars: ✭ 1,307 (+1261.46%)
Mutual labels:  jquery
Jquery Sortablejs
A jQuery binding for SortableJS
Stars: ✭ 94 (-2.08%)
Mutual labels:  jquery
Gdb
Generic Data Binder (GDB) for jQuery is a framework agnostic and extremely easy to use 2 way data binder. GDB binds views and models in realtime with live two-way binding and no hefty framework necessary.
Stars: ✭ 90 (-6.25%)
Mutual labels:  jquery
Pdfjsannotations
Wrapper for PDF JS to add annotations
Stars: ✭ 90 (-6.25%)
Mutual labels:  jquery
Bigtube
YouTube player is too small to watch people writing code!
Stars: ✭ 94 (-2.08%)
Mutual labels:  jquery
Snapaper
📰 Past Papers Sharing Platform Based On Vue.js & GCE Guide | CAIE 试卷分享与下载平台
Stars: ✭ 90 (-6.25%)
Mutual labels:  jquery
Jquery.rotate
Simple plugin that add rotate css property and animation
Stars: ✭ 95 (-1.04%)
Mutual labels:  jquery
Slidercaptcha
Slider captcha support mobile
Stars: ✭ 88 (-8.33%)
Mutual labels:  jquery
Translucent
Translucent plastic card theme.
Stars: ✭ 93 (-3.12%)
Mutual labels:  jquery
Pretty Dropdowns
A simple, lightweight jQuery plugin to create stylized drop-down menus.
Stars: ✭ 96 (+0%)
Mutual labels:  jquery
Happy Chat
基于node+express的聊天室,支持发送文本、图片、表情、自定义字体颜色、窗口震动
Stars: ✭ 96 (+0%)
Mutual labels:  jquery
Basictable
Basic Table jQuery or Vanilla JS plugin for simple responsive tables.
Stars: ✭ 94 (-2.08%)
Mutual labels:  jquery

dependsOn

Support

A jQuery plugin to facilitate the handling of form field dependencies.

$( subject ).dependsOn( dependencySet, [options] );

Examples

Demo

Installation

with npm

npm install --save jquery-depends-on

with Bower

bower install --save jquery-depends-on

Download directly

Latest Release

Build from source

git clone https://github.com/dstreet/dependsOn.git
cd dependsOn
npm install
gulp

# --> dist/dependsOn.min.js

Usage

Include jQuery (requires v1.7 or higher)

<script type="text/javascript" src="jquery/jquery-1.7.2.min.js"></script>

Include dependsOn

<script type="text/javascript" src="dependsOn.min.js"></script>

Add form components

<form id="myForm">
	<label for="myCheck">Check Me</label>
	<input type="checkbox" id="myCheck">

	<label for="myText">Input</label>
	<input type="text" id="myText" value="">
</form>

Activate plugin

$('#myText').dependsOn({
	// The selector for the depenency
	'#myCheck': {
		// The dependency qualifiers
		enabled: true,
		checked: true
	}
});

Qualifiers

  • enabled: (Boolean) If true, then dependency must not have the "disabled" attribute.
  • checked: (Boolean) If true, then dependency must not have the "checked" attribute. Used for checkboxes only.
  • values: (Array) Dependency value must equal one of the provided values.
  • not: (Array) Dependency value must not equal any of the provided values.
  • match: (RegEx) Dependency value must match the regular expression.
  • notMatch: (RegEx) Dependency value must not match the regular expression.
  • contains: (Array) One of the provided values must be contained in an array of dependency values. Used for select fields with the "multiple" attribute.
  • email: (Boolean) If true, dependency value must match an email address.
  • url: (Boolean) If true, Dependency value must match an URL.
  • range: (Array) Dependency value must be within the given range.
  • Custom: (Function) Custom function which return true or false.

Options

  • disable: (Boolean) Add "disabled" attribute to the subject's form field. Default: true
  • readonly: (Boolean) Add "readonly" attribute to the subject's form field. Default: false
  • hide: (Boolean) Hide the subject on disable and reveal the subject on enable. Default: true
  • duration: (Number) The time in milliseconds for the fade transition. Used only if hide is set to true. Default: 200
  • trigger: (String) The event used to check dependencies. Default: 'change'
  • onEnable: (Function) The callback function to execute when the subject has been enabled. Default: Empty Function
  • onDisable: (Function) The callback function to execute when the subject has been disabled. Default: Empty Function
  • valueOnEnable: (String) The value to set the subject to when enabled.
  • valueOnDisable: (String) The value to set the subject to when disabled.
  • checkOnEnable: (Boolean) If true, "checked" attribute will be added to subject when enabled. If false, "checked" attribute will be removed from subject when enabled. For checkboxes and radio buttons.
  • checkOnDisable: (Boolean) If true, "checked" attribute will be added to subject when disabled. If false, "checked" attribute will be removed from subject when disabled. For checkboxes and radio buttons.
  • valueTarget: (String) jQuery selector for the object to you want to target for editing the value. Use if you want to alter the value of something other than the subject.
  • toggleClass: (String) The class you wish to be appended to the subject when enabled. The class will be removed when the subject is disabled.

Callbacks

When the onEnable and onDisable callbacks are called, this is set to the last triggered dependency, and the function is passed two arguments:

  • e: The triggering event object
  • $subject: The jQuery object of the subject

Other Libraries

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].