diff --git a/lam/lib/html.inc b/lam/lib/html.inc
index fb123646..7e17862f 100644
--- a/lam/lib/html.inc
+++ b/lam/lib/html.inc
@@ -368,6 +368,8 @@ class htmlInputField extends htmlElement {
private $fieldSize = 30;
/** field max length (default 255) */
private $fieldMaxLength = 255;
+ /** on keypress event */
+ private $onKeyPress = null;
/** password field */
private $isPassword = false;
/** enabled or disabled */
@@ -458,7 +460,11 @@ class htmlInputField extends htmlElement {
if (!$this->isEnabled) {
$disabled = ' disabled';
}
- echo '';
+ $onKeyPress = '';
+ if ($this->onKeyPress != null) {
+ $onKeyPress = ' onkeypress="' . $this->onKeyPress . '"';
+ }
+ echo '';
// autocompletion
if ($this->autocomplete) {
echo "