diff options
author | Fabio Bas <ctrlaltca@gmail.com> | 2013-09-17 23:47:50 +0200 |
---|---|---|
committer | Fabio Bas <ctrlaltca@gmail.com> | 2013-09-17 23:47:50 +0200 |
commit | d9fc469530dd70be8dfdf337a525437774629ede (patch) | |
tree | 940992b653b47853df29df6997f55e84797b4288 /framework/Web/Javascripts/source | |
parent | 577e690f1ce437150443fe89635b6a6ef7aab0f1 (diff) |
Avoid triggering the default button of the form when pressing enter over a valid <a href='..'>; fixes #4803.2.2.03
Diffstat (limited to 'framework/Web/Javascripts/source')
-rw-r--r-- | framework/Web/Javascripts/source/prado/controls/controls.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/framework/Web/Javascripts/source/prado/controls/controls.js b/framework/Web/Javascripts/source/prado/controls/controls.js index fd8a4c91..8ea6afe3 100644 --- a/framework/Web/Javascripts/source/prado/controls/controls.js +++ b/framework/Web/Javascripts/source/prado/controls/controls.js @@ -419,9 +419,10 @@ Prado.WebUI.DefaultButton = Class.create(Prado.WebUI.Control, { var enterPressed = Event.keyCode(ev) == Event.KEY_RETURN; var isTextArea = Event.element(ev).tagName.toLowerCase() == "textarea"; + var isHyperLink = Event.element(ev).tagName.toLowerCase() == "a" && Event.element(ev).hasAttribute("href"); var isValidButton = Event.element(ev).tagName.toLowerCase() == "input" && Event.element(ev).type.toLowerCase() == "submit"; - if(enterPressed && !isTextArea && !isValidButton) + if(enterPressed && !isTextArea && !isValidButton && !isHyperLink) { var defaultButton = $(this.options['Target']); if(defaultButton) |