From a138615a9689cfd1106bb47fee678a3bf4b0bf2d Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 25 Jan 2010 02:45:38 +0000 Subject: [PATCH] API CHANGE Moved GSTNumberField from sapphire/forms to new 'formfields_nz' module git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@97475 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- forms/GSTNumberField.php | 55 ---------------------------------------- 1 file changed, 55 deletions(-) delete mode 100755 forms/GSTNumberField.php diff --git a/forms/GSTNumberField.php b/forms/GSTNumberField.php deleted file mode 100755 index 46ec56087..000000000 --- a/forms/GSTNumberField.php +++ /dev/null @@ -1,55 +0,0 @@ -form->FormName(); - $error = _t('GSTNumberField.VALIDATIONJS', 'Please enter a valid GST Number'); - $jsFunc =<< 0 && !value.match(/^[0-9]{2}[\-]?[0-9]{3}[\-]?[0-9]{3,4}\$/)) { - validationError(el,"$error","validation",false); - return false; - } - return true; - } - } -}); -JS; - Requirements::customScript($jsFunc, 'func_validateGSTNumber'); - - return "\$('$formID').validateGSTNumber('$this->name');"; - } - - function validate($validator){ - $valid = preg_match( - '/^[0-9]{2}[\-]?[0-9]{3}[\-]?[0-9]{3,4}$/', - $this->value - ); - - if(!$valid){ - $validator->validationError( - $this->name, - _t('GSTNumberField.VALIDATION', "Please enter a valid GST Number"), - "validation", - false - ); - return false; - } - - return true; - } - -} -?> \ No newline at end of file