Q:

Problem with OnKeyDown and window.location in FireFox

I have a small script that shall redirect to another page when return is pressed in a textbox, it works fine in IE, Chrome, Safari but not in FireFox. If i attatch the Debugger in FireBug it works.
here is my script:
<form name="form1" method="post" action="Default2.aspx" id="form1">

    <input id="ind" onkeydown="defaultButton(event)" />

    <script type="text/javascript">

        function defaultButton(event) {
            if (event.keyCode == 13) {
                event.returnValue = false;
                event.cancel = true;
                Send();
            }
        }

        function Send() {
            var content = document.getElementById("ind").value;

            if (content == null || content.length == 0) {
                document.getElementById("ind").focus();
                return;
            } else {
                window.location = "http://www.google.com?name=" + content;
            }
        } 
    </script>

Is thre anybody there can help med get this working cross browser?
Thank very much in advance!!

A:

You can try calling preventDefault
    function defaultButton(event) {
        if (event.keyCode == 13) {
            event.returnValue = false;

            if (event.preventDefault) {
                event.preventDefault();
            }

            Send();
        }
    }

