Add this javascript code:
<script>
function getKey(e)
{
//for internet fix
var k = (window.event) ? event.keyCode : e.keyCode;
alert(k);
}
</script>
html code:
<input type="text" onkeypress="getKey(event)" />
<script>
function getKey(e)
{
//for internet fix
var k = (window.event) ? event.keyCode : e.keyCode;
alert(k);
}
</script>
html code:
<input type="text" onkeypress="getKey(event)" />
2 comments:
You can also do it by using srcElement to distinguish between browsers...i.e (e.srcElement)? foo: bar; but you need to pass 'this' as an argument to the function instead of event...anyway theres always new ways..so just shared...
Ya, It might also be a way to handle this. I haven't tried yet.
Anyways, Thanks for the sharing..
@VHNG
Post a Comment