protected function validateWidget(&$arrField, $strRow, $strKey, &$varInput)
    {
        $varValue  = $varInput[$strRow][$strKey];
        $objWidget = $this->initializeWidget($arrField, $strRow, $strKey, $varValue);
        if (!is_object($objWidget)) {
            return false;
        }

        // Hack for checkboxes.
        if (($arrField['inputType'] == 'checkbox') && isset($varInput[$strRow][$strKey])) {
            $_POST[$objWidget->name] = $varValue;
        }

        $objWidget->validate();

        $varValue = $objWidget->value;

        // Convert date formats into timestamps (check the eval setting first -> #3063).
        $rgxp = $arrField['eval']['rgxp'];
        if (($rgxp == 'date' || $rgxp == 'time' || $rgxp == 'datim') && $varValue != '') {
            $objDate  = new Date($varValue, $GLOBALS['TL_CONFIG'][$rgxp . 'Format']);
            $varValue = $objDate->tstamp;
        }

        $varValue = $this->handleSaveCallback($arrField, $objWidget, $varValue);

        $varInput[$strRow][$strKey] = $varValue;

        // Do not submit if there are errors.
        if ($objWidget->hasErrors()) {
            return false;
        }

        return true;
    }