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 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 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? 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> 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 Link to comment https://forums.phpfreaks.com/topic/106287-autofill-textfield/#findComment-544783 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.