replacing a keystroke

R

runner7

The following code works in IE to replace an "enter" keystroke with a
"tab" keystroke in the first text box:

<html>
<head><title></title>

<script type="text/javascript">
function replace(e) {
if (e.keyCode==13) e.keyCode=9
}
</script>

</head>

<body>

<form>
<input onkeydown="replace(event)" /><br />
<input />
</form>

</body>
</html>

If you replace the "keyCode" property with the "which" property for
Firefox, the code does not work in Firefox. Can anyone tell me how to
fix this code to work in Firefox?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,277
Latest member
VytoKetoReview

Latest Threads

Top