We've moved! You can find modules, themes and widgets on http://addons.silverstripe.org.
This page will no longer be updated, and disappear soon. Module maintainers, please read our announcement to find out how to add your modules there.

NetefxValidator 0.7 [Unreleased]

Maintainer(s): lx
Supported by: Community

NetefxValidator is a class for form validation, so it replaces the RequiredFields() validator.
Features:

  • A lot of build in validationrules
  • logical rule combination
  • validationrule for unique database fields
  • custom validation functions
  • works in getCMSValidator() in Modeladmin
  • ...

In version 0.3 there is no javascript validation at all. So you can disable js-validation in your _config.php

The latest version is now on https://github.com/lx-berlin/NetefxValidator

Documentation: http://www.netefx.de/Silverstripe-NetefxValidator.php

 

Form validation in Silverstripe 2.4

When you build forms in silverstripe, you can use a RequiredFields-validator (official documentation). This validator defines which fields have to be filled in. But often this is not enough. If you want to make sure, that your form (frontend or backend) is filled correctly, your rules have to be more restrictive. There are specific fields in sapphire, like the EmailField() (official API documentation), which have a validationrule themeselves. But it doesnt make sense to define a separate class for every field of your form just for validation purposes.

What is does:

You can use the NetefxValidator to perform any validation you want. You can write NetefxValidatorRules of several types and add them to the validator. Each rule belongs to a form field, has a type, parameters and an error message, which is displayed to the user, if the rule does not validate. There are different types of rules, like REQUIRED rules, which simply express, that a field has to be filled, numeric rules, which are used to compare an input field to a fixed value or to other input fields, REGEXP rules, which expect a regular expression to check for and FUNCTION rules, in which you can use your self-written functions or library functions. Finally you can combine rules to a new rule using logical rule combination.

What is missing:

  • There is no Javascript validation at all.
  • The validator is not integrated in module Userforms.

Installation:

Just move the folder "NetefxValidator" to your projectfolder.

Detailed Documentation:

http://www.netefx.de/Silverstripe-NetefxValidator.php

Release(s)

  • Latest release

    Version: [Unreleased]
    Date: 2011-11-20
    Compatible with: SilverStripe 2.4.4, 2.4.5
    Download: NetefxValidator.zip

  • Latest master build

    To get a preview of our next release, download the latest build of unstable git master branch here. Please be careful: this is more likely to contain bugs, especially on modules undergoing a lot of development.

    SHA hash: 7b5af6d0064dd768ecee124012acf9c5164c5d32
    Build Date: 2013-09-17
    Download:

    Unstable Git access: https://github.com/lx-berlin/NetefxValidator

 
 

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.