diff --git a/public_html/includes/class/class.LSform.php b/public_html/includes/class/class.LSform.php index f4c1a7fe..099be618 100644 --- a/public_html/includes/class/class.LSform.php +++ b/public_html/includes/class/class.LSform.php @@ -615,6 +615,23 @@ class LSform { return $this -> elements[$element]; } + /** + * Return the values of an element + * + * If form is posted, retreive values from postData, otherwise + * retreive value from the element. + * + * @param[in] string $element The element name + * + * @retval mixed The element values + **/ + public function getValue($element) { + if ($this -> isSubmit() && $this -> _postData) { + return $this -> _postData[$element]; + } + return $this -> elements[$element] -> getValue(); + } + /** * Défini les valeurs des élements à partir des valeurs postées *