public function addElement(FormElement $element) {

		if(!empty($this->elements[$element->getName()])) {
			
			throw new HtmlFormException(sprintf("Element '%s' already assigned.", $element->getName()));
			
		}

		$this->elements[$element->getName()] = $element;
		$element->setForm($this);

		return $this;

	}