Merged revisions 47401 via svnmerge from

svn://svn.silverstripe.com/silverstripe/modules/sapphire/branches/2.2.0-mesq

........
  r47401 | ischommer | 2007-12-20 16:21:21 +1300 (Thu, 20 Dec 2007) | 1 line
  
  using formfield title (instead of id) for required validation message (on serverside)
........


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@52180 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2008-04-06 03:33:15 +00:00
parent a9020f477e
commit 770f55e9a5

View File

@ -102,12 +102,13 @@ JS;
} }
if($this->required) { if($this->required) {
foreach($this->required as $field) { foreach($this->required as $field) {
if($fields->dataFieldByName($field) && !$data[$field]) { $fieldObj = $fields->dataFieldByName($field);
if($fieldObj && !$data[$field]) {
$this->validationError( $this->validationError(
$field, $field,
sprintf( sprintf(
_t('Form.FIELDISREQUIRED'), _t('Form.FIELDISREQUIRED'),
strip_tags($field) strip_tags($fieldObj->Title())
), ),
"required" "required"
); );