Click here to Skip to main content
15,898,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have textbox when i am entering value in one textbox automatically value should change in another textbox.plz help me?
Posted

why Don't you use textbox_textchanged event handler in this case??
Good example for beginners:
http://www.dotnetperls.com/textchanged[^]
 
Share this answer
 
Comments
Member 9027346 5-Mar-13 6:22am    
i used textchanged event but i want to show the value without clicking on page.mns value changes but when i enter value in 1st textbox and click somewhere then it shows the value but i want to show at the same time when i enter value in 1st textbox?
Anurag Sinha V 5-Mar-13 6:31am    
Hey, You can have an event called OnBlur() on the HTML input box.
And OnBlur will be defined as a Javascript function.Whenver the first input box looses focus your text in the second input box would change.
Will it help??

-Anurag
you can use JavaScript, here is the example:-

your TextBox:-
ASP.NET
<asp:textbox id="txtbox1" runat="server" onkeyup="changeText()"></asp:textbox>
<asp:textbox id="txtBox2" runat="server" ></asp:textbox>


here is the Javascript function, which has been called on onkeyup event of txtbox1:
JavaScript
function changeText() {
    var txt1 = document.getElementById("<%= txtbox1.ClientID %>");
    var txt2 = document.getElementById("<%= txtBox2.ClientID %>");
    txt2.value = txt1.value;
 }


Good luck.
 
Share this answer
 
v3

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