public function getValidFormValues($getSubmits = false) {

		if(is_null($this->requestValues)) {

			throw new HtmlFormException('Values can not be evaluated. No request bound.', HtmlFormException::NO_REQUEST_BOUND);

		}

		$tmp = new ValuesBag();

		foreach($this->elements as $name => $e) {

			if(is_array($e)) {

				$vals = [];

				foreach($e as $ndx => $elem) {

					if(!$elem->isValid()) {
						continue;
					}

					// @todo since elements in an array are all of same type they don't need to be checked individually
					
					if($elem->canSubmit() && !$getSubmits) {
						continue;
					}

					if($elem instanceof CheckboxElement && !in_array($elem->getValue(), $this->requestValues->get($name, []))) {
						continue;
					}

					$vals[$ndx] = $elem->getModifiedValue();
				}

				$tmp->set($name, $vals);

			}

			else {

				if(
					$e->canSubmit() && !$getSubmits ||
					!$e->isValid() ||
					$e instanceof CheckboxElement && !$this->requestValues->get($name)
				) {
					continue;
				}

				$tmp->set($name, $e->getModifiedValue());

			}
		}

		return $tmp;

	}
public function getValidFormValues($getSubmits = false) {

		if(is_null($this->requestValues)) {

			throw new HtmlFormException('Values can not be evaluated. No request bound.', HtmlFormException::NO_REQUEST_BOUND);

		}

		$tmp = new ValuesBag();

		foreach($this->elements as $name => $e) {

			if(is_array($e)) {

				$vals = [];

				foreach($e as $ndx => $elem) {

					if(!$elem->isValid()) {
						continue;
					}

					// @todo since elements in an array are all of same type they don't need to be checked individually
					
					if($elem->canSubmit() && !$getSubmits) {
						continue;
					}

					if($elem instanceof CheckboxElement && !in_array($elem->getValue(), $this->requestValues->get($name, []))) {
						continue;
					}

					$vals[$ndx] = $elem->getModifiedValue();
				}

				$tmp->set($name, $vals);

			}

			else {

				if(
					$e->canSubmit() && !$getSubmits ||
					!$e->isValid() ||
					$e instanceof CheckboxElement && !$this->requestValues->get($name)
				) {
					continue;
				}

				$tmp->set($name, $e->getModifiedValue());

			}
		}

		return $tmp;

	}
public function getValidFormValues ( $ getSubmits = false ) { if ( is_null ( $ this -> requestValues ) ) { throw new HtmlFormException ( 'Values can not be evaluated. No request bound.' , HtmlFormException :: NO_REQUEST_BOUND ) ; } $ tmp = new ValuesBag ( ) ; foreach ( $ this -> elements as $ name => $ e ) { if ( is_array ( $ e ) ) { $ vals = [ ] ; foreach ( $ e as $ ndx => $ elem ) { if ( ! $ elem -> isValid ( ) ) { continue ; } // @todo since elements in an array are all of same type they don't need to be checked individually if ( $ elem -> canSubmit ( ) && ! $ getSubmits ) { continue ; } if ( $ elem instanceof CheckboxElement && ! in_array ( $ elem -> getValue ( ) , $ this -> requestValues -> get ( $ name , [ ] ) ) ) { continue ; } $ vals [ $ ndx ] = $ elem -> getModifiedValue ( ) ; } $ tmp -> set ( $ name , $ vals ) ; } else { if ( $ e -> canSubmit ( ) && ! $ getSubmits || ! $ e -> isValid ( ) || $ e instanceof CheckboxElement && ! $ this -> requestValues -> get ( $ name ) ) { continue ; } $ tmp -> set ( $ name , $ e -> getModifiedValue ( ) ) ; } } return $ tmp ; }
deliver all valid form values

@param boolean $getSubmits,deliver submit buttons when TRUE, defaults to FALSE
@return ValuesBag

@throws HtmlFormException
deliver all valid form values