Hello,
I would like to enter text into an input field, hit the TAB key and auto-populate another field based on the value of the input field. Is there a way to do that any javascript?
Thanks for all of your help
Chess
<i> </i><input type="text" onkeypress="getTheKey(event,this)" value="hit tab after focus"><br> <input type="text" id="something" value=""> <script type="text/javascript"> function getTheKey(){ var daKey=(typeof event=='undefined')?arguments[0].keyCode:event.keyCode; if(daKey==9){//tab copyContents(arguments[1]) } return true } function copyContents(t){ document.getElementById("something").value=t.value } </script>
Help @chess25 spread the word by sharing this article on Twitter...