Click here to Skip to main content
16,018,419 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have 2 textbox and labels when enters a values in textbox one then automatically shows a value in another textbox
Posted
Comments
[no name] 15-Jun-15 1:44am    
so what is the problem?
Member 11755626 15-Jun-15 1:52am    
problem when enters a value in example label subjectcode AN textbox automatically doesnot show the value in another lable subject name i want automatically shows the value in dataset value
Rashmi Sutar 15-Jun-15 2:08am    
hi,
can you please share your code.

Quote:
i have 2 textbox and labels when enters a values in textbox one then automatically shows a value in another textbox
You have to code for that. You need to handle the onchange Event of TextBox either in client side using JavaScript or at server side using C# or something else.

Important thing is that you have to handle that event, which will be fired whenever the TextBox value is changed. Inside that event, you have to assign the Text value of the first TextBox to the second TextBox.
 
Share this answer
 
Comments
Member 11755626 15-Jun-15 3:30am    
Actually problem its different i ll tell you for example u entered value in label districtcode ex in a textbox-AN next step another districtname label the textbox value automatically shows in that textbox already i created the database the distictname in database BangaloreNorth though the dataset how can i write the code pls send me the code
THANKS IN ADVANCE
I could not able to understand what you are saying. Please explain properly with full stops where needed. If you read your reply again as a lay man, you can't understand anything.
C#
<asp:textbox id="TextBox1" onkeyup="WriteText();" runat="server"></asp:textbox>

JavaScript
<script type="text/javascript">
    function WriteText()
    {
        var TextBox1= document.getElementById(TextBox1);
        var Label1= document.getElementById(Label1);
        Label1.innerText=TextBox1.value;
    }
 </script>
 
Share this answer
 
v2
Comments
Member 11755626 15-Jun-15 3:29am    
Actually problem its different i ll tell you for example u entered value in label districtcode ex in a textbox-AN next step another districtname label the textbox value automatically shows in that textbox already i created the database the distictname in database BangaloreNorth though the dataset how can i write the code pls send me the code
THANKS IN ADVANCE

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