function autovalue($fieldname, $default = null) {
		if ($this->autocomplete !== null) {
			$fieldname = rtrim($fieldname, '[]');
			if (isset($this->autocomplete[$fieldname])) {
				return $this->autocomplete[$fieldname];
			}
		}

		// no auto complete value found
		return $default;
	}