public function isValid(array $values)
    {
        $this->errorMessages = [];
        
        foreach ($this->elements->getElements() as $element) {
            $elementId = $element->getID();
            if (empty($elementId)) {
                continue;
            }
            
            $value = null;
            if (array_key_exists($elementId, $values)) {
                $value = $values[$elementId];
            }
            $element->setValue($value);
            
            $this->filterElement($element);
            $this->validateElement($element);
        }
        
        return count($this->errorMessages) === 0;
    }