Hi
I'm trying to force a keypress inside a textfield using javascript. This has to work specifically on IE but it simply doesn't work.
Can anyone help me?
My test script is this one:
<html>
<body>
<input type="text" id="txtfld">
<input type="button" onclick="go()">
<script>
function go() {
var q = document.getElementById('txtfld');
q.style.backgroundColor='yellow';
q.focus();
var evObj = document.createEventObject();
evObj.keyCode = 84; // [T] key
q.fireEvent('onkeypress', evObj);
}
</script>
</body>
</html>
Thanks in advance!