PHPackages                             sheadawson/silverstripe-dependentdropdownfield - 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. sheadawson/silverstripe-dependentdropdownfield

ActiveSilverstripe-vendormodule[Utility &amp; Helpers](/categories/utility)

sheadawson/silverstripe-dependentdropdownfield
==============================================

A silverstripe dropdown field that has it's options populated via ajax, based on the value of the field it depends on

4.0.0(10mo ago)28232.8k↓11.5%37[3 issues](https://github.com/sheadawson/silverstripe-dependentdropdownfield/issues)18BSD-3-ClausePHPPHP ^8.3

Since Sep 13Pushed 10mo ago6 watchersCompare

[ Source](https://github.com/sheadawson/silverstripe-dependentdropdownfield)[ Packagist](https://packagist.org/packages/sheadawson/silverstripe-dependentdropdownfield)[ Docs](https://github.com/sheadawson/silverstripe-dependentdropdownfield)[ RSS](/packages/sheadawson-silverstripe-dependentdropdownfield/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (3)Versions (18)Used By (18)

silverstripe-dependentdropdownfield
===================================

[](#silverstripe-dependentdropdownfield)

A SilverStripe dropdown field that has its options populated via ajax, based on the value of the field it depends on.

Requirements
------------

[](#requirements)

SilverStripe 6

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

[](#installation)

```
composer require sheadawson/silverstripe-dependentdropdownfield

```

Usage example
-------------

[](#usage-example)

### With dropdown field

[](#with-dropdown-field)

```
// 1. Create a callable function that returns an array of options for the DependentDropdownField.
// When the value of the field it depends on changes, this function is called passing the
// updated value as the first parameter ($val)
$datesSource = function($val) {
	if ($val == 'one') {
		// return appropriate options array if the value is one.
	}
	if ($val == 'two') {
		// return appropriate options array if the value is two.
	}
};

$fields = FieldList::create(
	// 2. Add your first field to your field list,
	$fieldOne = DropdownField::create('FieldOneID', 'Field One', ['one' => 'One', 'two' => 'Two']),
	// 3. Add your DependentDropdownField, setting the source as the callable function
	// you created and setting the field it depends on to the appropriate field
	DependentDropdownField::create('FieldTwoID', 'Field Two', $datesSource)->setDepends($fieldOne)
);
```

### With listbox field

[](#with-listbox-field)

```
// 1. Create a callable function that returns an array of options for the DependentListboxField.
// When the value of the field it depends on changes, this function is called passing the
// updated value as the first parameter ($val)
$datesSource = function($val) {
	if ($val == 'one') {
		// return appropriate options array if the value is one.
	}
	if ($val == 'two') {
		// return appropriate options array if the value is two.
	}
};

$fields = FieldList::create(
	// 2. Add your first field to your field list,
	$fieldOne = ListboxField::create('FieldOneManyManyRelation', 'Field One', [1 => 'One', 2 => 'Two']),
	// 3. Add your DependentListboxField, setting the source as the callable function
	// you created and setting the field it depends on to the appropriate field
	DependentListboxField::create('FieldTwoManyManyRelation', 'Field Two', $datesSource)->setDepends($fieldOne)
);
```

###  Health Score

59

—

FairBetter than 99% of packages

Maintenance52

Moderate activity, may be stable

Popularity47

Moderate usage in the ecosystem

Community36

Small or concentrated contributor base

Maturity87

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 54% 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 ~247 days

Recently: every ~218 days

Total

17

Last Release

309d ago

Major Versions

1.0.4 → 2.0.02018-02-16

1.0.x-dev → 2.0.12020-06-18

2.0.3 → 3.0.02023-02-22

3.x-dev → 4.0.02025-07-13

PHP version history (4 changes)1.0.0PHP &gt;=5.3.2

2.0.0PHP &gt;=5.6

3.0.0PHP &gt;=7.4

4.0.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ca23b453a4fc5ac237ad4fcc512f68fab5c7b124f403cad1a5848b3fffb6aa2?d=identicon)[sheadawson](/maintainers/sheadawson)

---

Top Contributors

[![sheadawson](https://avatars.githubusercontent.com/u/1166136?v=4)](https://github.com/sheadawson "sheadawson (27 commits)")[![dannidickson](https://avatars.githubusercontent.com/u/86586656?v=4)](https://github.com/dannidickson "dannidickson (4 commits)")[![3Dgoo](https://avatars.githubusercontent.com/u/2616373?v=4)](https://github.com/3Dgoo "3Dgoo (2 commits)")[![grgcnnr](https://avatars.githubusercontent.com/u/2694014?v=4)](https://github.com/grgcnnr "grgcnnr (2 commits)")[![satrun77](https://avatars.githubusercontent.com/u/166450?v=4)](https://github.com/satrun77 "satrun77 (2 commits)")[![tony13tv](https://avatars.githubusercontent.com/u/4117485?v=4)](https://github.com/tony13tv "tony13tv (2 commits)")[![altwohill](https://avatars.githubusercontent.com/u/629254?v=4)](https://github.com/altwohill "altwohill (1 commits)")[![manuelteuber](https://avatars.githubusercontent.com/u/655280?v=4)](https://github.com/manuelteuber "manuelteuber (1 commits)")[![mfendeksilverstripe](https://avatars.githubusercontent.com/u/26395487?v=4)](https://github.com/mfendeksilverstripe "mfendeksilverstripe (1 commits)")[![micschk](https://avatars.githubusercontent.com/u/1005986?v=4)](https://github.com/micschk "micschk (1 commits)")[![muskie9](https://avatars.githubusercontent.com/u/870751?v=4)](https://github.com/muskie9 "muskie9 (1 commits)")[![nyeholt](https://avatars.githubusercontent.com/u/161730?v=4)](https://github.com/nyeholt "nyeholt (1 commits)")[![spronkey](https://avatars.githubusercontent.com/u/430712?v=4)](https://github.com/spronkey "spronkey (1 commits)")[![sgray-circle8](https://avatars.githubusercontent.com/u/24728163?v=4)](https://github.com/sgray-circle8 "sgray-circle8 (1 commits)")[![cameronbourgeois](https://avatars.githubusercontent.com/u/1127276?v=4)](https://github.com/cameronbourgeois "cameronbourgeois (1 commits)")[![chrispenny](https://avatars.githubusercontent.com/u/505788?v=4)](https://github.com/chrispenny "chrispenny (1 commits)")[![bhofstaetter](https://avatars.githubusercontent.com/u/9002671?v=4)](https://github.com/bhofstaetter "bhofstaetter (1 commits)")

---

Tags

silverstripedropdown

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sheadawson-silverstripe-dependentdropdownfield/health.svg)

```
[![Health](https://phpackages.com/badges/sheadawson-silverstripe-dependentdropdownfield/health.svg)](https://phpackages.com/packages/sheadawson-silverstripe-dependentdropdownfield)
```

###  Alternatives

[silverstripe/subsites

Run multiple sites from a single SilverStripe install.

65392.9k20](/packages/silverstripe-subsites)[symbiote/silverstripe-advancedworkflow

Adds configurable workflow support to the CMS, with a GUI for creating custom workflow definitions.

46295.2k7](/packages/symbiote-silverstripe-advancedworkflow)[silverstripe/taxonomy

Provide extra taxonomy for cataloguing the data.

10481.5k19](/packages/silverstripe-taxonomy)[dnadesign/silverstripe-advanceddropdowns

DropdownField and GroupedDropdownField that allows the use of data-attributes on each option tag

1717.3k](/packages/dnadesign-silverstripe-advanceddropdowns)[dnadesign/silverstripe-datedropdownselectorfield

Select your date values with Dropdown Fields

138.8k](/packages/dnadesign-silverstripe-datedropdownselectorfield)[wedevelopnl/silverstripe-elemental-grid

Elemental grid module

1014.1k2](/packages/wedevelopnl-silverstripe-elemental-grid)

PHPackages © 2026

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