0

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?

tamih
  • 93
  • 1
  • 15
  • try removing event as argument when you call function: submitOnEnter();. Maybe it could help – Ilya Sidorovich Oct 31 '12 at 08:32
  • thanks. I found a solution i canged the ice:form... to "ice:form id="queryForm" onkeydown="submitOnEnter(event);" partialSubmit="true"" – tamih Oct 31 '12 at 12:50

0 Answers0