I am using Icefaces 3 .
I want to perform javascript function when enter key is pressed on the form.
I used this code in my previous applications (on Icefaces 1.8) and it worked fine . but now this is not working in Icefaces3 :
here is my code :
<ice:form id="queryForm" onkeydown="submitOnEnter(event);">
and in my header I have :
<script type="text/javascript">
function submitOnEnter(event){
alert("submitOnEnter");
if( event.keyCode == 13 || evt.keyCode == 13 )
{
document.getElementById('queryForm:formSubmit').click();
}
};
</script>
the javascript doesn't work when I am using keys events , but when I am using mouse events they work o.k.
how can I fix this?