Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
How to duplicate typed text over multiple text boxes
Old 05-27-2008, 04:28 AM How to duplicate typed text over multiple text boxes
Novice Talker

Posts: 5
Trades: 0
Is there a way to fill multiple text boxes by only filling in the first one? I believe it's javascript.
Freeman is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-27-2008, 11:23 AM Re: How to duplicate typed text over multiple text boxes
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
Is there a way to fill multiple text boxes by only filling in the first one
Yes there is.

Quote:
I believe it's javascript
Yes, it can be.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-27-2008, 11:31 AM Re: How to duplicate typed text over multiple text boxes
wchua24's Avatar
Ultra Talker

Posts: 357
Location: florida
Trades: 0
yes....i asked my friend the same question and answered yes... but i don't know how..sorry..
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

wchua24 is offline
Reply With Quote
View Public Profile
 
Old 05-30-2008, 09:17 PM Re: How to duplicate typed text over multiple text boxes
Experienced Talker

Posts: 39
Name: Andrew
Trades: 0
HTML Code:
<script type="text/javascript">
function copyText()
{
	document.getElementById("copy").value = document.getElementById("source").value;
}

function copyText2(e)
{
	if (!e) var e = window.event;
	document.getElementById("copy").value = document.getElementById("source2").value + String.fromCharCode(e.keyCode ? e.keyCode : e.which);
}
</script>

...

<input type="text" id="source" value="" onkeyup="copyText();" />
<input type="text" id="source2" value="" onkeypress="copyText2(event);" />
<input type="text" id="copy" value="" />
Obviously there's scope for some optimisation, but that should do it. The keypress one gives a slightly snappier perceived response, but needs an additional check (not in the code above) that the key pressed is printable.
__________________

Please login or register to view this content. Registration is FREE
- Pole dancing evolved
meloncholy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How to duplicate typed text over multiple text boxes
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13663 seconds with 12 queries