Click here to Skip to main content
15,880,299 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have place textbox and label, i would need when enter the values in textbox at a time label should show the textbox values. how should i do this. i have try using javascrip but didn't work. anyone knows informme.
Thanking you
Posted

Use Javascript[^].
<asp:textbox id="TextBox1" runat="server" onkeyup="document.getElementById('Label1').innerHTML = document.getElementById('TextBox1').value">

<asp:label id="Label1" runat="server" text="Label">
 
Share this answer
 
v2
Comments
Sunasara Imdadhusen 2-Sep-11 9:39am    
This will not work if user press key for long time!
Toniyo Jackson 2-Sep-11 9:42am    
What? Did you try this? This will work in all way
rkthiyagarajan 2-Sep-11 11:29am    
Its work nicely thanks a lot
rkthiyagarajan 2-Sep-11 11:29am    
Its work nicely thanks a lot
Use following:
JavaScript
<div id="divText" />
   <input size="40" onkeydown="PrintText(this);" />
 function PrintText(_this){
            document.GetElementById("divText").innerText = _this.value;
        }
 
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