tags:

views:

700

answers:

1

Does anyone know what is going on here? When I pressed the key once, in IE8 it's always calls the function in javascript twice. It's working fine by only call the fundtion once when the keypredd in firefox but not in IE8.

HTML:

<input onkeypress="return isNumberKey(event, this);"  />

Javascript:

function isNumberKey(evt, obj)
{

    alert('unavailable'). 
    return false

}
+1  A: 

Works for me IE8 on Vista, (8.0.6001.18813)

<script>
function isNumberKey() {
    document.title += 1;
    return false;
}
</script>
<input type="text" onkeypress="return isNumberKey();">

I only see the title get appended a single "1" at a time. Maybe you have some other code going amiss? Your posted code has an obvious syntax error, so maybe there's something else you're leaving out?

Svend