Jump to content

[SOLVED] Just curious if this is possible with PHP...


galvin

Recommended Posts

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!

 

 

 

<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>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.