Canman2005 Posted May 19, 2008 Share Posted May 19, 2008 Hi all I am wondering if anyone knows if a script exists to do the following. What I need is 2 html text form fields, when you enter text into one of the text fields, it would automatically update the other form field with the first letter of what was typed. So for example, if you have the 2 form fields and you enter Google into the field, then it would automatically enter G into the other text field. Does anyone know if this exists? Thanks Dave Quote Link to comment https://forums.phpfreaks.com/topic/106287-autofill-textfield/ Share on other sites More sharing options...
RichardRotterdam Posted May 19, 2008 Share Posted May 19, 2008 dunno if it can be found online but this one should be pretty easy to make by yourself using the document.getElmenetById() function Quote Link to comment https://forums.phpfreaks.com/topic/106287-autofill-textfield/#findComment-544700 Share on other sites More sharing options...
Canman2005 Posted May 19, 2008 Author Share Posted May 19, 2008 I dunno DjKat, im pretty useless with Javascript Have you seen any examples like that? Quote Link to comment https://forums.phpfreaks.com/topic/106287-autofill-textfield/#findComment-544704 Share on other sites More sharing options...
RichardRotterdam Posted May 19, 2008 Share Posted May 19, 2008 here is a start for you <script> function setInput(passedValue){ document.getElementById('input2').value=passedValue; } </script> <form> <input onkeyup="setInput(this.value)" type="text" id="input1" /> <input type="text" id="input2" /> </form> Quote Link to comment https://forums.phpfreaks.com/topic/106287-autofill-textfield/#findComment-544757 Share on other sites More sharing options...
Canman2005 Posted May 19, 2008 Author Share Posted May 19, 2008 nice, thanks Quote Link to comment https://forums.phpfreaks.com/topic/106287-autofill-textfield/#findComment-544783 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.