I want to hit enter key to go to p2.htm or p3.htm according to the input text that I was typing in. And I also want to hit submit1 button to alert('no1') manually.
It works in FireFox, but in IE6, when I hit enter key it will submit the submit button.
How can I make the thing right in IE 6 as it is in FireFox?
I use javascript and jQuery.
<input id="Text2" type="text" onkeyup="if(event.keyCode==13){go2();}" />
<input id="Text3" type="text" onkeyup="if(event.keyCode==13){go3();}" />
<input id="submit1" type="submit" value="submit" onclick="alert('no1')" />
<script type="text/javascript">
function go2()
{
window.location = "p2.htm";
}
function go3()
{
window.location = "p3.htm";
}
</script>