Weiß jemand, warum das Onkeydown() Ereignis nicht funktioniert für Löschen und Rücktaste in IE? Es funktioniert gut für Zahlen- und Zeichenschlüssel.Onkeydown() funktioniert nicht für Löschen und Backspace in IE
0
A
Antwort
0
Sind Sie sicher? .. sieht folgende löschen und Backspace fein auf IE:
<html>
<head>
<script type="text/javascript">
function keypress(e)
{
var keycode;
if (window.event) // IE
{
keycode = e.keyCode;
}
else if (e.which) // Netscape/FF/Op
{
keycode = e.which;
}
alert(keycode);
}
</script>
</head>
<body>
<form>
<input type="text" onkeydown="return keypress(event)" />
</form>
</body>
</html>
+0
ja, nicht sicher, warum dies nicht Aufruf der Funktion überhaupt ist, wenn Sie Backspace drücken oder löschen –
Verwandte Themen
- 1. Warum funktioniert stage.addEventListener (KeyboardEvent.KEY_DOWN, onKeyDown, true) nicht?
- 2. Backspace unterdrücken, Schlüssel in MaskedTextbox löschen
- 3. attachBrowserEvent KeyPress, Backspace funktioniert nicht in Chrome
- 4. onKeyDown Firefox
- 5. Stop Backspace Formular löschen bestimmte Ausgabe
- 6. Back button/backspace funktioniert nicht mit window.history.pushState
- 7. Onkeydown-Ereignis für HTML-Formular nicht feuern in IE 7 oder FF 3
- 8. Code funktioniert nicht in IE und Edge
- 9. JavaScript funktioniert nicht in FF und IE
- 10. Ubuntu Eclipse: Backspace-Taste funktioniert wie Löschtaste
- 11. auf keypress jquery Funktion funktioniert Backspace nicht
- 12. erhabener Text 3 ctrl Backspace funktioniert nicht
- 13. Bildgröße funktioniert nicht in Mozilla und IE
- 14. Ext.get und Update funktioniert nicht in IE
- 15. Iframe funktioniert nicht in Firefox und IE
- 16. CSS funktioniert nicht in IE?
- 17. window.focus funktioniert nicht in IE
- 18. Sortierung funktioniert nicht in IE
- 19. JS onclick und onkeydown in chrome
- 20. ExternalInterface funktioniert nicht in IE
- 21. Border-Farbe funktioniert nicht in IE
- 22. scrollTop funktioniert nicht auf Firefox und IE?
- 23. ELEMENT.style.color funktioniert nicht in IE
- 24. window.print nicht in IE funktioniert
- 25. $ .post funktioniert nicht in IE
- 26. $ .getJSON funktioniert nicht in IE
- 27. element.trigger() funktioniert nicht in IE
- 28. .es funktioniert nicht in IE
- 29. IE-Eingang funktioniert nicht
- 30. document.getElementById(). Value und document.getElementById(). Checked funktioniert nicht für IE
siehe auch http://stackoverflow.com/questions/664631/disable-backspace-and-delete-key-with-javascript-in-ie – derobert
Für welche Version von IE testen Sie? –