PHPackages                             lekoala/silverstripe-form-extras - 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. lekoala/silverstripe-form-extras

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

lekoala/silverstripe-form-extras
================================

Form extras for Silverstripe

1.2.14(4y ago)243733[1 issues](https://github.com/lekoala/silverstripe-form-extras/issues)1BSD-3-ClauseJavaScriptCI failing

Since Apr 3Pushed 2y ago6 watchersCompare

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

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

Silverstripe Form extras module
===============================

[](#silverstripe-form-extras-module)

Utilities to get better forms with Silverstripe

Handling jquery, mousewheel and gestures
========================================

[](#handling-jquery-mousewheel-and-gestures)

We try to favor jquery.mousewheel and hammer as librairies to handle mousewheel and gestures. The idea is to try to avoid include other librairies that would do the job twice, leading to duplicated code and extra load time.

You can use the following helper to load these libraries in your own project:

```
FormExtraJquery::include_jquery();
FormExtraJquery::include_jquery_ui();
FormExtraJquery::include_hammer();
FormExtraJquery::include_mousewheel();

```

Base form class
===============

[](#base-form-class)

New functionnalities
--------------------

[](#new-functionnalities)

The FormExtra class comes with some simple but nice functionnalities.

- It will save and restore the data if the validation fails
- It provides some response shortcuts (like return $this-&gt;err('Failed!') )

There are also two new actions:

- FormActionArrow: a form action with an arrow (simple :-) )
- FormActionConfirm: a form action with a confirm text (really, just on onclick="confirm...")

Multi steps forms
-----------------

[](#multi-steps-forms)

The FormExtraMulti class implements multi steps functionnality.

Each step is represented by a single "Form" object. Classes must be named in a sequential manner (Like MyFormStep1, MyFormStep2 ...) because the class name is used to determine which is the current step, the next step etc...

Actions are defined by calling

```
$actions = $this->definePrevNextActions()

```

This will create two actions: doPrev and doNext. doPrev will not be set on the first step while doNext will be translated differently on the last step.

By default, clicking on these buttons will simply save the data to the session and navigate into the form. It's up to you to override these methods to achieve what you want to do.

A template is also provided to add steps at the top of your forms. This template consumes the AllSteps method on the form that returns all steps with their properties.

NOTE: don't forget that validation will happen if you go back (doPrev) in the form. This might not be a desirable behaviour. If used in conjonction with ZenValidator, the FormActionNoValidation will be used to make sure that the validation does not happen when going back (while still saving the current state, allowing the user to freely navigate without losing data).

New fields
==========

[](#new-fields)

MiniColorsField
---------------

[](#minicolorsfield)

A field that uses the "minicolors" jquery plugin to pick a color. Its best to store the color using the DBColor field instead of a regular Varchar(7). You can set the theme using the MiniColorsField::setTheme method

BaseUploadField
---------------

[](#baseuploadfield)

An UploadField with a factory method to get an upload field with a folder name already set depending on the context. This context takes into account the current Subsite by default if the module is enabled. Otherwise the tendancy is to put everything in the "Uploads" folder which become quite unmanageable after some time.

ImageUploadField
----------------

[](#imageuploadfield)

An UploadField already set up for image upload

Sample usage:

```
$fields->replaceField('Logo', ImageUploadField::createForClass($this, 'Logo'));

```

FrontendUploadField
-------------------

[](#frontenduploadfield)

An UploadField ready to be used on the frontend. To allow editing on the frontend, make sure that you have a canEditFrontend method that returns true (according to whatever your security settings are).

This also adds a "Gallery" functionnality. Supports for "cropbox", "focuspoint" as image resize modules.

BetterCheckboxField
-------------------

[](#bettercheckboxfield)

The default checkbox field in Silverstripe doesn't send any value if not checked. This one does!

BirthDateField
--------------

[](#birthdatefield)

If you are like me and that your customers ask you to split the birthdate field in three...

ChosenField
-----------

[](#chosenfield)

A dropdown field integrated with Chosen

CmsInlineFormAction
-------------------

[](#cmsinlineformaction)

As you may have noticed, the InlineFormAction class doesn't work quite well. This alternative is bare bones but does the job.

ComboField
----------

[](#combofield)

A dropdown where values can be appended by the user.

MaskedInputField
----------------

[](#maskedinputfield)

A field that use Inputmask

PostcodeField
-------------

[](#postcodefield)

A field that validates postcodes according to a country.

RegexTextField
--------------

[](#regextextfield)

A field that validates against a specific regex

Select2Field
------------

[](#select2field)

A field that uses Select2. Version 3 and 4 are supported.

SexyPasswordField
-----------------

[](#sexypasswordfield)

A field that validates password according to your Member::password\_validator()

SliderField
-----------

[](#sliderfield)

A field that uses jQuery ui slider

TableField
----------

[](#tablefield)

A field that supports multiple columns and unlimited rows. Data is stored as json.

SimpleTinyMceField
------------------

[](#simpletinymcefield)

A simple TinyMceField plugin for frontend use

CropboxField
------------

[](#cropboxfield)

A field that uses CropboxField

GridField
=========

[](#gridfield)

GridFieldConfig\_RecordDefault
------------------------------

[](#gridfieldconfig_recorddefault)

A default config that uses GridFieldSortableRows, GridFieldOrderableRows and GridFieldBulkManager

GridFieldConfig\_RelationDefault
--------------------------------

[](#gridfieldconfig_relationdefault)

A default config that uses GridFieldSortableRows, GridFieldOrderableRows and GridFieldBulkManager

GridFieldDownloadButton
-----------------------

[](#gridfielddownloadbutton)

WIP

GridFieldExportAllButton
------------------------

[](#gridfieldexportallbutton)

The default export to csv button export only the current list, not all items. While this is nice in a way, sometimes your clients want to have a full export. Simple use this button to achieve this.

NOTE : to make your csv files open nicely on excel, simple use:

```
$btn->setCsvSeparator(';');

```

HasOne helper
=============

[](#hasone-helper)

Sometimes, you want to add a button to edit a HasOne relationship or even embed all the fields right inside a tab.

HasOneButtonField
-----------------

[](#hasonebuttonfield)

Simple add the button as any other field:

```
new HasOneButtonField($name,$title,$this);

```

Embed all fields
----------------

[](#embed-all-fields)

Thanks to the HasOneEditDataObjectExtension, all fields named like Relation:Name or Relation/Name will load and save data from and to the Relation.

```
new TextField('MyRelation:MyField','My field name')

```

Recommended modules
===================

[](#recommended-modules)

Works best with

- Zenvalidator :
- Display Logic :

Compatibility
=============

[](#compatibility)

Tested with 3.1

Maintainer
==========

[](#maintainer)

LeKoala -

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 97.3% 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 ~159 days

Recently: every ~124 days

Total

17

Last Release

1510d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/250762?v=4)[Thomas Portelange](/maintainers/lekoala)[@lekoala](https://github.com/lekoala)

---

Top Contributors

[![lekoala](https://avatars.githubusercontent.com/u/250762?v=4)](https://github.com/lekoala "lekoala (285 commits)")[![tomzi](https://avatars.githubusercontent.com/u/4091451?v=4)](https://github.com/tomzi "tomzi (5 commits)")[![Shetza](https://avatars.githubusercontent.com/u/5880072?v=4)](https://github.com/Shetza "Shetza (3 commits)")

---

Tags

silverstripecmsmoduleformExtras

### Embed Badge

![Health badge](/badges/lekoala-silverstripe-form-extras/health.svg)

```
[![Health](https://phpackages.com/badges/lekoala-silverstripe-form-extras/health.svg)](https://phpackages.com/packages/lekoala-silverstripe-form-extras)
```

###  Alternatives

[lekoala/silverstripe-cms-actions

Add actions to your models in SilverStripe

39279.9k22](/packages/lekoala-silverstripe-cms-actions)[nathancox/codeeditorfield

A field for editing code and JSON in the SilverStripe CMS using Ace Editor (http://ace.c9.io/)

2548.5k5](/packages/nathancox-codeeditorfield)[symbiote/silverstripe-grouped-cms-menu

Allows you to group CMS menu items.

3696.2k6](/packages/symbiote-silverstripe-grouped-cms-menu)

PHPackages © 2026

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