mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
parents-merge 40044 - add resetData() function so that the payment can be reset and used the 'real' data after a order form submitted.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@45059 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
4a65391d09
commit
528fb572fe
@ -561,6 +561,17 @@ class Form extends ViewableData {
|
||||
return $data;
|
||||
}
|
||||
|
||||
function resetData($fieldName, $fieldValue){
|
||||
$dataFields = $this->fields->dataFields();
|
||||
if($dataFields){
|
||||
foreach($dataFields as $field) {
|
||||
if($field->Name()==$fieldName) {
|
||||
$field = $field->setValue($fieldValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Call the given method on the given field.
|
||||
* This is used by Ajax-savvy form fields. By putting '&action=callfieldmethod' to the end
|
||||
|
Loading…
Reference in New Issue
Block a user