PHPackages                             thewebmen/silverstripe-ajaxforms - 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. thewebmen/silverstripe-ajaxforms

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

thewebmen/silverstripe-ajaxforms
================================

Silverstripe ajax form module

1.0.1(8y ago)22.4k1BSD-3-ClausePHP

Since Feb 23Pushed 8y ago4 watchersCompare

[ Source](https://github.com/wedevelopnl/silverstripe-ajaxforms)[ Packagist](https://packagist.org/packages/thewebmen/silverstripe-ajaxforms)[ RSS](/packages/thewebmen-silverstripe-ajaxforms/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

SilverStripe Ajax Forms
=======================

[](#silverstripe-ajax-forms)

Introduction
------------

[](#introduction)

Ajax forms for silverstripe, using jquery and jquery validate

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

[](#requirements)

- SilverStripe CMS ^4.0
- jQuery
- jQuery validate

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

[](#installation)

```
composer require "thewebmen/silverstripe-ajaxforms"

```

How to use
----------

[](#how-to-use)

Make sure you have jquery and jquery validate loaded on your pages with ajax forms. Also include the following js file:

```
Requirements::javascript('thewebmen/silverstripe-ajaxforms:resources/js/ajaxforms.js');

```

Then create a form by extending the class TheWebmen\\Ajaxforms\\AjaxForm that returns an instance of the TheWebmen\\Ajaxforms\\AjaxFormResponse class on success.

### Form example

[](#form-example)

```
use TheWebmen\Ajaxforms\AjaxForm;
use SilverStripe\Control\RequestHandler;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\FormAction;
use SilverStripe\Forms\TextField;
use SilverStripe\Forms\RequiredFields;

class ExampleForm extends AjaxForm {

    public function __construct(RequestHandler $controller = null)
    {
        $fields = new FieldList(array(
            TextField::create('MyField', 'This is a field')
        ));

        $actions = new FieldList(array(
           FormAction::create('handle', 'Send')
        ));

        $validator = new ExampleFormValidator(array(
            'MyField'
        ));

        parent::__construct($controller, 'MyField', $fields, $actions, $validator);
    }

    public function handle($data){
        $response = new \TheWebmen\Ajaxforms\AjaxFormResponse();
        return $response->redirect('http://www.google.nl');
    }

}

class ExampleFormValidator extends RequiredFields {

    public function php($data)
    {
        $valid = parent::php($data);
        if($data['MyField'] != 'Test'){
            $this->validationError(
                'MyField',
                'This field is only valid if the value is: Test',
                'required'
            );
            $valid = false;
        }
        return $valid;
    }

}

```

Form errors are displayed using jQuery validate, you can initiate your own jQuery validate to customize the settings or you can let the ajaxforms.js script handle this to use jQuery validate's default settings.

The class ".is-posting" is added to the form while it is positing, you should use this class to add some progress styling.

Todo
----

[](#todo)

- Improve documentation
- Add check if page exist for the redirectToPage response

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity65

Established project with proven stability

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

3

Last Release

3006d ago

Major Versions

0.0.1 → 1.0.02018-02-23

### Community

Maintainers

![](https://www.gravatar.com/avatar/7a41b16aafbe795cfad0b4941b9ac37305e5bba2aefbcf56cc1f0c180928de27?d=identicon)[WeDevelop](/maintainers/WeDevelop)

---

Tags

silverstripeajaxform

### Embed Badge

![Health badge](/badges/thewebmen-silverstripe-ajaxforms/health.svg)

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

###  Alternatives

[burnbright/silverstripe-externalurlfield

Provides SilverStripe with a DBField and FormField for handling external URLs.

109.6k1](/packages/burnbright-silverstripe-externalurlfield)

PHPackages © 2026

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