Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Input in textarea and display in text box... 1

Status
Not open for further replies.

codeone

Programmer
Joined
Mar 25, 2003
Messages
343
Location
US
Hello, I was wondering if anyone knew how to type a character in a textarea and have its value displayed in the textarea and also in a text box (both on the same page)?

Any help would be appreciated . . . thanks.

Code One
 
like so?

<html>
<head>

<script language=&quot;javascript&quot;>
function transfer(sText, oTo) {
oTo.value = sText;
}
</script>

</head>

<body>
<form>
<textarea name=&quot;ta&quot;
onkeyup=&quot;transfer(this.value, this.form.t);&quot;></textarea>
<p/>
<input type=&quot;text&quot; name=&quot;t&quot; />
</form>
</body>
</html>




=========================================================
try { succeed(); } catch(E) { tryAgain(); }
-jeff
 
Like so!

Nice job,

Code One
 
edit to above ª post: Well not exactly. I just got threw messing with this code for about 2 hours trying to minipulate it to work as I need it to but I am rather new to Jscript and I have to admit my powers are limited, though according to my post this code would be exactly what I needed. Anyway . . .

What I need is for when the user presses a button lets say the (A) button on the users keyboard the output inside the textarea would be the number 10. Now I have a text box [on the same page] and I would like onKeyup the letter (A) to be outputed in the textbox minus the value which is set to be the number 10 vs. the actual value of the pressed button which is the letter (A).

I hope you understand and can help all is much appreciated,

Code One
 
i'm not sure what you're after...

where do you get the number 10 for the character &quot;A&quot;?

and this has really got me confused: &quot;onKeyup the letter (A) to be outputed in the textbox minus the value which is set to be the number 10 vs. the actual value of the pressed button which is the letter (A). &quot;

=========================================================
try { succeed(); } catch(E) { tryAgain(); }
-jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top