<script>
function MoveNext(e, obj) {
if (!e) var e = window.event;
if (e.keyCode) code = e.keyCode;
else if (e.which) code = e.which;
if (code == 13) {
document.getElementById(obj).focus();
return false;
}
</script>
the above code is working in IE but not in mozilla why
Exactly what the best code is for the return key depends upon which keyboard event you are listening to (keydown, keyup, keypress). For keypress, you can do it like this:
Note: I've remove your local variable
eso it doesn't get confused with the argumenteand I've definedcodeas a local variable which you had as an implicit global variable (never a good thing).More on cross browser key handling described here: keycode and charcode.