aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Typing in two text boxes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Typing in two text boxes" Watch "Typing in two text boxes" New topic
Author

Typing in two text boxes

Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1526
I want to copy contents of one text from one into another this has to happen in real time as if I am typing in two text boxes simultaneously, how can I achieve this using javascript?



Above code lags by one key press.


Keep Smiling Always — My life is smoother when running silent. -paul
[FAQs] [Certification Guides] [The Linux Documentation Project]
Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1526
I am trying keypress event but it is showing blank for all the characters alert is just "Character typed: ".


Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1526
Got it.

<html>
<script>
function copyTextBoxes(evt) {
// evt = window.event;
var groupNameTxt = document.getElementById('groupName');
var fnameTxt = document.getElementById('fname');
groupNameTxt.value=fnameTxt.value + " Users";
}


</script>
<body>
<form name="addLDAPApplicationGroup" action="demo_form.asp">
<input type="text" id="groupName" name="groupName" disabled value="disabled">

<input type="text" id="fname" name="fname" onKeyUp="copyTextBoxes(this)" onmouseup="copyTextBoxes(this)" onmouseover="copyTextBoxes(this)">

<input type="button" value="Submit">
</form>
</body>
</html>

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Typing in two text boxes