Commit 41bd9007 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

add submit on enter press

parent 179838e3
......@@ -24,7 +24,7 @@ require_once 'Zend/Form/Element.php';
/**
* Base element for XHTML elements
*
*
* @category Zend
* @package Zend_Form
* @subpackage Element
......@@ -34,4 +34,10 @@ require_once 'Zend/Form/Element.php';
*/
abstract class Zend_Form_Element_Xhtml extends Zend_Form_Element
{
public function __construct($name, $options) {
$options = array_merge(['onkeypress' => 'if (event.keyCode == 13) {this.form.submit();return false;}'],
$options);
return parent::__construct($name, $options);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment