Click here to Skip to main content
15,914,416 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,
I'm working on ASP.NET. I Have textbox and checkboxlist with 5 items on my aspx page.
When I check the item in checkboxlist then corresponding item should be display in textbox.
Is it possible to do with Javascript. If so please give me some idea or sample code.
If can't possible with javascript, Can it possible on AJAX? Please send me sample code for this.
Posted
Updated 8-Sep-11 16:54pm
v2

Hi,you can use this
C#
function Test() {
            var chk = document.getElementById('<%= chk.ClientID %>');//Asp.net Check box
            var txt = document.getElementById('<%= txt.ClientID %>');//ASP.net Text box
            if (chk.checked)
                    txt.value = chk.value;
        }


Call this function on ASP.net button's OnClientClick event
 
Share this answer
 
function Test() {
var chk = document.getElementById('<%= chk.ClientID %>');

if (chk.checked)
txt.value = chk.value;
}
 
Share this answer
 
v2

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