public function getSubmittingElement() {

		// cache submitting element

		if(!empty($this->clickedSubmit)) {
			return $this->clickedSubmit;
		}

		if(is_null($this->requestValues)) {
			return null;
		}

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

			if(is_array($e)) {

				// parse one-dimensional arrays

				foreach($this->requestValues->keys() as $k) {

					if(preg_match('/^' . $name . '\\[(.*?)\\]$/', $k, $m)) {

						if(isset($this->elements[$name][$m[1]]) && $this->elements[$name][$m[1]]->canSubmit()) {

							$this->clickedSubmit = $this->elements[$name][$m[1]];
							return $this->clickedSubmit;

						}
					}

				}

				foreach($e as $k => $ee) {

					if(
						$ee instanceof ImageElement &&
						($arr = $this->requestValues->get($name . '_x')) &&
						isset($arr[$k])
					) {
						$this->clickedSubmit = $ee;
						return $ee;
					}

					else if(
						$ee->canSubmit() &&
						($arr = $this->requestValues->get($name)) &&
						isset($arr[$k])
					) {
						$this->clickedSubmit = $ee;
						return $ee;
					}
				}
			}

			else if($e instanceof ImageElement && !is_null($this->requestValues->get($name . '_x'))) {
				$this->clickedSubmit = $e;
				return $e;
			}
			else if($e->canSubmit() && !is_null($this->requestValues->get($name))) {
				$this->clickedSubmit = $e;
				return $e;
			}

		}
	}
public function getSubmittingElement() {

		// cache submitting element

		if(!empty($this->clickedSubmit)) {
			return $this->clickedSubmit;
		}

		if(is_null($this->requestValues)) {
			return null;
		}

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

			if(is_array($e)) {

				// parse one-dimensional arrays

				foreach($this->requestValues->keys() as $k) {

					if(preg_match('/^' . $name . '\\[(.*?)\\]$/', $k, $m)) {

						if(isset($this->elements[$name][$m[1]]) && $this->elements[$name][$m[1]]->canSubmit()) {

							$this->clickedSubmit = $this->elements[$name][$m[1]];
							return $this->clickedSubmit;

						}
					}

				}

				foreach($e as $k => $ee) {

					if(
						$ee instanceof ImageElement &&
						($arr = $this->requestValues->get($name . '_x')) &&
						isset($arr[$k])
					) {
						$this->clickedSubmit = $ee;
						return $ee;
					}

					else if(
						$ee->canSubmit() &&
						($arr = $this->requestValues->get($name)) &&
						isset($arr[$k])
					) {
						$this->clickedSubmit = $ee;
						return $ee;
					}
				}
			}

			else if($e instanceof ImageElement && !is_null($this->requestValues->get($name . '_x'))) {
				$this->clickedSubmit = $e;
				return $e;
			}
			else if($e->canSubmit() && !is_null($this->requestValues->get($name))) {
				$this->clickedSubmit = $e;
				return $e;
			}

		}
	}
public function getSubmittingElement ( ) { // cache submitting element if ( ! empty ( $ this -> clickedSubmit ) ) { return $ this -> clickedSubmit ; } if ( is_null ( $ this -> requestValues ) ) { return null ; } foreach ( $ this -> elements as $ name => $ e ) { if ( is_array ( $ e ) ) { // parse one-dimensional arrays foreach ( $ this -> requestValues -> keys ( ) as $ k ) { if ( preg_match ( '/^' . $ name . '\\[(.*?)\\]$/' , $ k , $ m ) ) { if ( isset ( $ this -> elements [ $ name ] [ $ m [ 1 ] ] ) && $ this -> elements [ $ name ] [ $ m [ 1 ] ] -> canSubmit ( ) ) { $ this -> clickedSubmit = $ this -> elements [ $ name ] [ $ m [ 1 ] ] ; return $ this -> clickedSubmit ; } } } foreach ( $ e as $ k => $ ee ) { if ( $ ee instanceof ImageElement && ( $ arr = $ this -> requestValues -> get ( $ name . '_x' ) ) && isset ( $ arr [ $ k ] ) ) { $ this -> clickedSubmit = $ ee ; return $ ee ; } else if ( $ ee -> canSubmit ( ) && ( $ arr = $ this -> requestValues -> get ( $ name ) ) && isset ( $ arr [ $ k ] ) ) { $ this -> clickedSubmit = $ ee ; return $ ee ; } } } else if ( $ e instanceof ImageElement && ! is_null ( $ this -> requestValues -> get ( $ name . '_x' ) ) ) { $ this -> clickedSubmit = $ e ; return $ e ; } else if ( $ e -> canSubmit ( ) && ! is_null ( $ this -> requestValues -> get ( $ name ) ) ) { $ this -> clickedSubmit = $ e ; return $ e ; } } }
Returns FormElement which submitted form, result is cached

@return FormElement
Returns FormElement which submitted form result is cached