Click here to Skip to main content
15,903,203 members
Please Sign up or sign in to vote.
1.22/5 (4 votes)
See more:
copy contents of textBox1 to textBox2 without pressing a button or anything/automatically copies as soon as I enter something on textBox1, then increment textBox2 by one.
Posted

I think you can use js to do :

$('#txt1').keypress(function(){
   $('#txt2').val($(this).val()) ;
});



by Wengdeli
 
Share this answer
 
Use onkeyup event of the textbox to copy value in another text box as you type. Try the code below

XML
<input id="txt1" type="text" onkeyup="document.getElementById('txt2').value = this.value;" />
<br />
<input id="txt2" type="text"  />
 
Share this answer
 
Comments
timJosh 1-Aug-13 6:59am    
how would I increment txt2 by 1?tnx
There is a framework called KnockOut.JS. Look at this as well.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900