PHPackages                             joacub/joacub-form-jqueryvalidate - 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. joacub/joacub-form-jqueryvalidate

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

joacub/joacub-form-jqueryvalidate
=================================

ZF2 module for extending forms with live clientside validation

1.0.8(11y ago)02621MITPHPPHP &gt;=5.3.3

Since Nov 6Pushed 9y ago1 watchersCompare

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

READMEChangelogDependencies (2)Versions (5)Used By (0)

StrokerForm
===========

[](#strokerform)

ZF2 module for extending forms with live clientside validation without need to write js validation code. You only need to define your validation rules server side with ZF2 and this module automaticaly adds the same rules with [jQueryValidate](http://docs.jquery.com/Plugins/Validation). In case a client side version of the validation rule doesn't exist a fallback is done using ajax. For basic usage examples see the sandbox project [StrokerFormSandbox](https://github.com/bramstroker/zf2-form-sandbox).

[![Build Status](https://camo.githubusercontent.com/f57ff087171bae5a78a498c789f044563646af46099e4120a3dfbd8fe1ff4cee/68747470733a2f2f7472617669732d63692e6f72672f6272616d7374726f6b65722f7a66322d666f726d2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/bramstroker/zf2-form)

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

[](#installation)

Installation of StrokerForm uses composer. For composer documentation, please refer to [getcomposer.org](http://getcomposer.org/).

1. `cd my/project/directory`
2. create or modify the `composer.json` file within your ZF2 application file with following contents:

    ```
    {
        "require": {
            "stroker/form": "*"
        }
    }
    ```
3. install composer via `curl -s https://getcomposer.org/installer | php` (on windows, download  and execute it with PHP). Then run `php composer.phar install`
4. open `my/project/directory/configs/application.config.php` and add the following key to your `modules`:

    ```
    'StrokerForm',
    ```
5. copy the assets to your public folder (my/project/directory/public).

Usage
-----

[](#usage)

First we need to make sure jquery is loaded by our application and the headScript() and inlineScript() view helpers are called. If you already have this in place you can skip this step.

```

  headLink() ?>
	headScript()->prependFile('//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js') ?>

	content; ?>

inlineScript() ?>

```

For the ajax validation to work inputfilters needs to be hooked to the form. We need to create a serviceFactory and register it with a unique alias to the formManager (this is an pluginManager). If the inputFilters are already set to the form (i.e. in your form constructor) it's enough to register the form as an invokable

```
