mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
CurrencyField::jsValidation() needs to register its validateCurrency function mulitiple times with different FormID for working in a popup of ComplexTableField where FormID is changed.
In general all Form Fields should imply with this rule if a page contain mulitiple forms, but this is not under our current developing cycle, since our form fields validation is changing to use jQuery. git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64896 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
84db28eb10
commit
132f4ae5ca
@ -60,9 +60,11 @@ Behaviour.register({
|
||||
});
|
||||
JS;
|
||||
|
||||
Requirements::customScript($jsFunc, 'func_validateCurrency');
|
||||
Requirements::customScript($jsFunc, 'func_validateCurrency_' .$formID);
|
||||
|
||||
return "\$('$formID').validateCurrency('$this->name');";
|
||||
return <<<JS
|
||||
if(\$('$formID')) \$('$formID').validateCurrency('$this->name');
|
||||
JS;
|
||||
}
|
||||
|
||||
function validate($validator) {
|
||||
|
@ -57,15 +57,17 @@ Behaviour.register({
|
||||
}
|
||||
});
|
||||
JS;
|
||||
Requirements :: customScript($jsFunc, 'func_validateDate');
|
||||
Requirements :: customScript($jsFunc, 'func_validateDate_'.$formID);
|
||||
|
||||
// return "\$('$formID').validateDate('$this->name');";
|
||||
return <<<JS
|
||||
if(\$('$formID')){
|
||||
if(typeof fromAnOnBlur != 'undefined'){
|
||||
if(fromAnOnBlur.name == '$this->name')
|
||||
$('$formID').validateDate('$this->name');
|
||||
\$('$formID').validateDate('$this->name');
|
||||
}else{
|
||||
$('$formID').validateDate('$this->name');
|
||||
\$('$formID').validateDate('$this->name');
|
||||
}
|
||||
}
|
||||
JS;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user