views:

934

answers:

1

Hi everybody,

I want to capture the enter key on text for windows ce msie6.0 but there is no button for that so i cannot use default button property for the form tag itself. What else i can do to capture the Enter key?

Thanks..

+1  A: 

I have used this function javascript in IE6, not sure if it will work in Windows CE

    <script languaje="javascript">
    document.onkeydown = myOnkeydown;  
    function myOnkeydown()
    {        
        var key = window.event.keyCode;
        if (key == 13) { //13 is the keycode of the 'Enter' key
           //do stuff
        }
    }
    </script>

Edit: This function captures the input in all fields. You can plug it to the textbox of your choice if you like.

Eduardo Molteni