protected function _prepare($name, $attributes) {
		// add error class ...
		if (isset($this->_errors[$name])) {
			if (isset($attributes['class'])) {
				$attributes['class'] .= ' ' . self::$error_class;
			} else {
				$attributes['class'] = self::$error_class;
			}
		}

		// add name
		if (!isset($attributes['name'])) {
			$attributes['name'] = $name;
		}

		// add id
		$attributes['id']	= $this->_form_prefix . (isset($attributes['id']) ? $attributes['id'] : str_replace(['[', ']'], '', $name));

		// add value
		// the name could be in array syntax like "field[]" but in the input array the field has the name "field"
		$input_key	= preg_replace('/\[[^]]*\]/', '', $attributes['name']);
		$value		= isset($this->_input[$input_key]) ? $this->_input[$input_key] : '';

		return [$attributes, $value];
	}