News

Log In Sponsors
Partner Sites

move focus... is it correct ?



Hello, i would like to know if this is the correct way to move the focus from a field to a button in order to avoid refreshing the page when the enter key is pressed. (It works on Safari.. but I've just realized it doesn't work on Firefox and IE. [code:1pfj9538]<form name="password1" onsubmit="javascript:submitentry()"> <input type="text" name="password2" size="15" onkeydown="if (window.event.keyCode==13) javascript:document.getElementById('submitbutton').focus()"><br> <input type="button" class="normaltexte" value="Submit" id="submitbutton" onClick="submitentry()"> </form>[/code:1pfj9538] thanks

Click here to read the whole forum topic