PHPackages                             vulcandigital/silverstripe-formpreserve - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. vulcandigital/silverstripe-formpreserve

ActiveSilverstripe-vendormodule[Validation &amp; Sanitization](/categories/validation)

vulcandigital/silverstripe-formpreserve
=======================================

Easily preserve and clear user entered form data contents via session in the event of errors

1.0.0(8y ago)07BSD-3-ClausePHP

Since Feb 23Pushed 8y ago1 watchersCompare

[ Source](https://github.com/vulcandigital/silverstripe-formpreserve)[ Packagist](https://packagist.org/packages/vulcandigital/silverstripe-formpreserve)[ RSS](/packages/vulcandigital-silverstripe-formpreserve/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (3)Versions (1)Used By (0)

silverstripe-formpreserve
=========================

[](#silverstripe-formpreserve)

Easily preserve and clear user entered form data contents via session in the event of errors

Requirements
============

[](#requirements)

- silverstripe/framework: ^4

Usage
=====

[](#usage)

```
class YourForm extends Form
{
    private static $extensions = [
        FormPreserveExtension::class
    ];

    public function __construct(RequestHandler $controller = null, $name = self::DEFAULT_NAME, FieldList $fields = null, FieldList $actions = null, $validator = null)
    {
        /** @var ArrayData $preserved */
        $preserved = $this->retrievePreserved();

        $fields = FieldList::create([
            TextField::create('FirstName', 'First name:', $preserved->FirstName)->setAttribute('required', true),
            EmailField::create('Email', 'Your email:', $preserved->Email)->setAttribute('placeholder', 'Where do we send our response?')->setAttribute('required', true),
        ]);

        $actions = FieldList::create([
            FormAction::create('doSubmit', 'Send')->setUseButtonTag(true)->setButtonContent(' Send')->addExtraClass('btn btn-primary')
        ]);

        parent::__construct($controller, $name, $fields, $actions, $validator);
    }
}
```

**Your form submit action:**

```
class ContactPageController extends \PageController
{
   public function doSubmit($data, Form $form)
    {
        FormPreserve::preserve($form, $data);

        if (!isset($data['Email']) || !filter_var($data['Email'], FILTER_VALIDATE_EMAIL)) {
            return $this->redirectBack();
        }

        FormPreserve::clear($form);
        return $this->redirectBack();
    }
}
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

3001d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/79352f13e05702b6ba2a9e27508d7cbd72e902342ff4e6608861b40a7cab5644?d=identicon)[vulcandigital](/maintainers/vulcandigital)

---

Top Contributors

[![zanderwar](https://avatars.githubusercontent.com/u/13566916?v=4)](https://github.com/zanderwar "zanderwar (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/vulcandigital-silverstripe-formpreserve/health.svg)

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

###  Alternatives

[undefinedoffset/silverstripe-nocaptcha

A spam protector and form field using Google's reCAPTCHA v2 or optionally a foundation v3 implementation

33471.6k16](/packages/undefinedoffset-silverstripe-nocaptcha)[sheadawson/silverstripe-zenvalidator

Faster, easier client and server-side form validation for SilverStripe

5778.4k2](/packages/sheadawson-silverstripe-zenvalidator)[jonom/silverstripe-text-target-length

Set character length recommendations on SilverStripe text form fields

32132.4k9](/packages/jonom-silverstripe-text-target-length)

PHPackages © 2026

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