Simultaneous text in ajax or php

I would like to create php code in such a way that when we are entering in the text box another box simultaneously displays what i am entering like a screen.That is i do not have to click a button before seeing the result.

For example i am typing here now.As i type ,the text that i type should be simultaneously displayed in another box (not this box) as a simultaneous text.
Is there any code in php for that?

This can be implemented in Javascript, even with no Ajax.

Here is example of such code:

Enter text here:<br>
<textarea cols="50" rows="5" onKeyPress="{document.getElementById('area2').value=this.value;}"></textarea>
you can see your text here too:<br>
<textarea id="area2" cols="50" rows="5"></textarea>

You can create file test.html, paste there the code above and try :slight_smile:

The above answer’s event can be modified to “onKeyUp”


Then the output can be seen while typing :slight_smile:

Sponsor our Newsletter | Privacy Policy | Terms of Service