private function setSuccessfulControlValues(array $formValues, $fields)
    {
        foreach ($fields as $key => $values) {
            if (isset($formValues[$key])) {
                if ($values['type'] === 'float') {
                    // We allow ',' and '.' as decimal point and need '.' internally
                    $formValues[$key] = str_replace(',', '.', $formValues[$key]);
                }
            } else {
                if ($values['type'] === 'select' && isset($values['multiple']) && $values['multiple'] === true) {
                    $formValues[$key] = [];
                } elseif ($values['type'] === 'checkbox') {
                    $formValues[$key] = 0;
                } elseif ($values['type'] === 'repeater' || $values['type'] === 'block') {
                    $formValues[$key] = [];
                }
            }
        }

        return $formValues;
    }
private function setSuccessfulControlValues(array $formValues, $fields)
    {
        foreach ($fields as $key => $values) {
            if (isset($formValues[$key])) {
                if ($values['type'] === 'float') {
                    // We allow ',' and '.' as decimal point and need '.' internally
                    $formValues[$key] = str_replace(',', '.', $formValues[$key]);
                }
            } else {
                if ($values['type'] === 'select' && isset($values['multiple']) && $values['multiple'] === true) {
                    $formValues[$key] = [];
                } elseif ($values['type'] === 'checkbox') {
                    $formValues[$key] = 0;
                } elseif ($values['type'] === 'repeater' || $values['type'] === 'block') {
                    $formValues[$key] = [];
                }
            }
        }

        return $formValues;
    }
private function setSuccessfulControlValues ( array $ formValues , $ fields ) { foreach ( $ fields as $ key => $ values ) { if ( isset ( $ formValues [ $ key ] ) ) { if ( $ values [ 'type' ] === 'float' ) { // We allow ',' and '.' as decimal point and need '.' internally $ formValues [ $ key ] = str_replace ( ',' , '.' , $ formValues [ $ key ] ) ; } } else { if ( $ values [ 'type' ] === 'select' && isset ( $ values [ 'multiple' ] ) && $ values [ 'multiple' ] === true ) { $ formValues [ $ key ] = [ ] ; } elseif ( $ values [ 'type' ] === 'checkbox' ) { $ formValues [ $ key ] = 0 ; } elseif ( $ values [ 'type' ] === 'repeater' || $ values [ 'type' ] === 'block' ) { $ formValues [ $ key ] = [ ] ; } } } return $ formValues ; }
Add successful control values to request values, and do needed corrections.

@see http://www.w3.org/TR/html401/interact/forms.html#h-17.13.2

@param array $formValues
@param array $fields

@return array
Add successful control values to request values and do needed corrections .