PHPackages                             ownede/jquery-depends-on - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ownede/jquery-depends-on

ActiveComponent[Utility &amp; Helpers](/categories/utility)

ownede/jquery-depends-on
========================

A jQuery plugin to facilitate the handling of form field dependencies

1.4.3(9y ago)014MITJavaScript

Since Nov 18Pushed 9y ago1 watchersCompare

[ Source](https://github.com/ownede/dependsOn)[ Packagist](https://packagist.org/packages/ownede/jquery-depends-on)[ Docs](http://github.com/dstreet/dependsOn)[ RSS](/packages/ownede-jquery-depends-on/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)DependenciesVersions (3)Used By (0)

dependsOn
=========

[](#dependson)

[![Support](https://camo.githubusercontent.com/036d299e45ffe203b5740c31501efa752d4f8829e36733a78e14f8b1e5f19c5a/68747470733a2f2f737570706f7274657268712e636f6d2f6170692f622f34337873666f666b346332786c696a7a366d767278357967612f646570656e64734f6e)](https://supporterhq.com/support/43xsfofk4c2xlijz6mvrx5yga/dependsOn)

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

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

Examples
--------

[](#examples)

[Demo](http://dstreet.github.com/dependsOn)

Installation
------------

[](#installation)

### with npm

[](#with-npm)

```
npm install --save jquery-depends-on

```

### with Bower

[](#with-bower)

```
bower install --save jquery-depends-on

```

### Download directly

[](#download-directly)

[Latest Release](https://github.com/dstreet/dependsOn/releases/latest)

### Build from source

[](#build-from-source)

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

# --> dist/dependsOn.min.js

```

Usage
-----

[](#usage)

**Include jQuery (requires v1.7 or higher)**

``

**Include dependsOn**

``

**Add form components**

```

	Check Me

	Input

```

**Activate plugin**

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

Qualifiers
----------

[](#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
-------

[](#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
---------

[](#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
---------------

[](#other-libraries)

- [rails\_depends\_on](https://github.com/francescob/rails_depends_on) - Rails Gem for dependsOn

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 80% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

3511d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/34365047?v=4)[kacpero](/maintainers/kacpero)[@KacperO](https://github.com/KacperO)

---

Top Contributors

[![dstreet](https://avatars.githubusercontent.com/u/1950982?v=4)](https://github.com/dstreet "dstreet (16 commits)")[![ownede](https://avatars.githubusercontent.com/u/442603?v=4)](https://github.com/ownede "ownede (2 commits)")[![dennisdupont](https://avatars.githubusercontent.com/u/8162159?v=4)](https://github.com/dennisdupont "dennisdupont (1 commits)")[![plastbox](https://avatars.githubusercontent.com/u/321822?v=4)](https://github.com/plastbox "plastbox (1 commits)")

### Embed Badge

![Health badge](/badges/ownede-jquery-depends-on/health.svg)

```
[![Health](https://phpackages.com/badges/ownede-jquery-depends-on/health.svg)](https://phpackages.com/packages/ownede-jquery-depends-on)
```

###  Alternatives

[tatter/workflows

Job task control through dynamic workflows, for CodeIgniter 4

211.7k](/packages/tatter-workflows)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
