I'd like it to be compatible with all major browsers one of which is IE. For IE, as many versions as possible is the answer.
I hope you can give me a solution.
I have searched a lot and found very little to help me.
Using this like as a source of inspiration:
http://stackoverflow.com/questions/6...ct-pressed-key
here's a demo I wrote to check its compatibility with IE and FF:
- <script>
-
function getEnterKey(evt)
-
{
-
var charCode = (evt.which) ? evt.which : evt.keyCode
-
if (charCode == 13)
-
alert("mine");
-
//return true;
-
}
-
</script>
-
-
-
-
<input type="text" onkeypress="return getEnterKey(event);">
-
<input type="text" onkeydown="return getEnterKey(event);">
-
It works both in IE and FF. In this code, I have used
Alert to check whether the function is called or not.
But, in the main example given in the 2nd post of this topic, IE does not work properly. You have to press "Send" button to post data.
I don't know what's wrong. I'm stuck.