diff --git a/src/main/java/net/bootsfaces/component/defaultCommand/DefaultCommand.java b/src/main/java/net/bootsfaces/component/defaultCommand/DefaultCommand.java index e9f4e5a50..9aedcaf0f 100644 --- a/src/main/java/net/bootsfaces/component/defaultCommand/DefaultCommand.java +++ b/src/main/java/net/bootsfaces/component/defaultCommand/DefaultCommand.java @@ -65,14 +65,14 @@ public void encodeEnd(FacesContext context) throws IOException { + BsfUtils.escapeJQuerySpecialCharsInSelector(formId) + " input').keypress(function (e) { " + " if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) { " + " document.getElementsByName('" + actionCommandId + "')[0].click();return false; " - + " } else { " + " console.log('keycode not 13'); " + " return true; " + + " } else { return true; " + " } " + " }); " + "});", null); rw.writeText("" + "$(function() { " + " $('form#" + BsfUtils.escapeJQuerySpecialCharsInSelector(formId) + " textarea').keypress(function (e) { " + " if ((e.ctrlKey && e.which && e.which == 13) || (e.ctrlKey && e.keyCode && e.keyCode == 13)) { " + " document.getElementsByName('" + actionCommandId + "')[0].click();return false; " - + " } else { " + " console.log('keycode not 13 or ctrl not pressed'); " + " return true; " + + " } else { return true; " + " } " + " }); " + "});", null); rw.endElement("script");