processing immediate text box value

Prabu R

Is it possible to have a text input field which displays somewhere else (e.g. in a div) what its content is on change?

Example: I type 1, so 1 is outputted somewhere on my screen immediatly, then I type 2 and the previous value is now updated to 12.

html

<input type="text" id="inputField" />
<div id="screen"></div>

script

document.getElementById('inputField').onkeyup = function(){
document.getElementById('screen').innerHTML = this.value;
};

The code is good but I want the screen's inner html value to be format in php. Example: the screen value is stored into $screen and then I'd echo the output where i want into the screen

[I want (echo "$screen";) like in php I will type the number in text box means it echo the value immediately used with php format]

how to store a screen value into variable $screen

Rams
<html  >
<head>
    <script type="text/javascript">
        function KeyHandler() {
            var result = document.getElementById('result');
            result.innerHTML=document.getElementById('txtInput').value;

        }
    </script>
</head>
<body >
<div>Type something.........</div><br />
<input type='text' id='txtInput'onkeyup="KeyHandler()" />

<br/>
Result:
<div id="result"></div>
</body>
</html>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

Get the value in an input text box

From Dev

The value of the text box prints as Undefined

From Dev

Input box text value trick

From Dev

Returning a value to a text box with JavaScript

From Dev

Passing Text box value into string

From Dev

set Rating value to text box

From Dev

Input text box value is not changing

From Dev

Need to save the value in a text box

From Dev

unable to assign text box value to another text box in jquery

From Dev

How to send the input text box value to angularjs onclick on the text box?

From Dev

How to send the input text box value to angularjs onclick on the text box?

From Dev

How to validate a second text box if there is a value in first text box?

From Dev

yasm: Expected `,' with immediate value

From Dev

Ruby: A check for immediate value?

From Dev

Get Text value after past value in text box

From Dev

Prevent Text Box Value Update if Invalid Data

From Dev

User text box input is rewritten by default value

From Dev

Trigger Event on Text box Value change

From Dev

Value will blink only once at the html text box

From Dev

assign a value to a text box using java script

From Dev

Unable to display value in HTML text input box

From Dev

Check is changed value in text box using class

From Dev

expand text field value box in PHPMyAdmin

From Dev

Changing a text box value upon selecting a file

From Dev

How to check if the value in a text box is prime or not with jQuery

From Dev

Reading c# combo box text and value?

From Dev

Enter the value in text box with JavaScript in HTML

From Dev

text box only displaying one word as value

From Dev

How to bind a simple string value to a text box?

Related Related

HotTag

Archive