galvin Posted December 2, 2008 Share Posted December 2, 2008 Is it possible (using PHP) to have a form where a user enter's text into a text field and have that text appears somewhere else on the page INSTANTLY, AS THE USER IS TYPING IT. So if the user types "I like monkeys", as soon as they type "I" in the text field, the letter "I" will appear somewhere else on the page before they even type the word "like". My hope is to allow users to type some text and I will have the text show up somewhere else instantly, formatted much nicer (using CSS). I've seen this type of thing on sites like "blogger.com" so I know it's possible, just not sure if PHP can do it. And I'm not asking anyone to write any code, I just need to be pointed in the right direction (if it is in fact possible to do this type of thing with PHP). Thanks! Quote Link to comment Share on other sites More sharing options...
Prismatic Posted December 2, 2008 Share Posted December 2, 2008 No, PHP is server side. What you want is Javascript Quote Link to comment Share on other sites More sharing options...
Psycho Posted December 2, 2008 Share Posted December 2, 2008 <html> <head> <script type="text/javascript"> function updateText(inputObj, outputID) { document.getElementById(outputID).innerHTML = inputObj.value; } </script> </head> <body> Type your input here: <input type="text" id="text" name="text" onkeyup="updateText(this, 'spanID');" /> <br /><br /> The text you are typing is: <span id="spanID"><span> </body> </html> Quote Link to comment 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.