It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

Help - this is probably simple but...

Help - this is probably simple but...

Postby edkellett on Wed Nov 03, 2010 12:42 am

Hi.

Can anyone point me in the direction of being able to create the script that allows the user to input text into an text box and it appears as you type on another part of the page.

An exact example of this can be found here:
http://www.meinedecke.de/shop/product_i ... ucts_id=51

There are probably great tutorials on this or sample code but I don't know what to search for it by.

Thanks in advance.
Ed
edkellett
 
Posts: 1
Joined: Wed Nov 03, 2010 12:22 am

Re: Help - this is probably simple but...

Postby HotNoob on Sun Nov 07, 2010 3:44 am

Code: Select all
<script>
function change()
{
   outText.innerHTML = inText.value;
}
</script>
<input type=text id=inputText onKeyUp="change();"/>
<div id=outputText></div>
<script>
//initalize variables, must be after elements loaded
var outText = document.getElementById('outputText');
var inText = document.getElementById('inputText');
</script>

tuda!

everytime the key goes up, the function change is called
which changes the values of the outputText, so it will be displayed there.
HotNoob
100+ Club
 
Posts: 169
Joined: Sun May 02, 2010 1:38 am


Who is online

Users browsing this forum: No registered users and 4 guests