Dispaly value of one textbox to another textbox using Jquery & Javascript

<html>
<h2>Display value of two Textbox in Another Textbox Using Jquery</h2>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#firstname, #lastname").keyup(function () {
var a = $("#firstname").val();
var b = $("#lastname").val();
var c= a + ' ' + b;
$("#fullname").val(c);
});
});
</script>
Fisrt name:-<input type="text" id="firstname" ></input>
Last Name:-<input type="text" id="lastname" ></input>
Full Name:-<input type="text" id="fullname" ></input>
</br>
<!-- ===================================================================== -->
<h2>Display value of two Textbox in Another Textbox Using Javascript</h2>
Fisrt name:-<input type="text" id="first" ></input>
Last Name:-<input type="text" id="last" onkeyUp="copyText()" ></input>
Full Name:-<input type="text" id="full" ></input>
<script type="text/javascript">
function copyText() {
first = document.getElementById("first");
last = document.getElementById("last");
full = document.getElementById("full");
full.value = first.value + ' ' + last.value;
}
</script>
<!-- ===================================================================== -->
<h2>Copy Text from One Textbox to Another Using Jquery </h2>
<script>
$(document).ready(function(){
$("#textBox").change(function () {
$("#message").val($('#textBox').val());
});
});
</script>
<div>
TextBox 1 : <input type="textbox" id="textBox" class="valueEnter"></input>
TextBox 2 : <input type="textbox" id="message"></input>
</div>
<!-- ===================================================================== -->
<h2>Copy Text from One Textbox to Another Using Javascript </h2>
<script>
function copyText2() {
textBox2 = document.getElementById("textBox2");
message2 = document.getElementById("message2");
message2.value = textBox2.value;
}
</script>
<div>
TextBox 1 : <input type="textbox" id="textBox2" onkeyUp="copyText2()"></input>
TextBox 2 : <input type="textbox" id="message2"></input>
</div>
</html>

Output
Vineet Kumar Saini

Advertisements
Categories: Joomla, PHP & Joomla | Tags: , , , , , , , , , | 3 Comments

Post navigation

3 thoughts on “Dispaly value of one textbox to another textbox using Jquery & Javascript

  1. Monoj Biswas

    thanks you so much,because in this site from i got a many help.

  2. Mike

    nice work buddy

  3. very very Thanks you so much

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: