Click here to Skip to main content
15,909,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all!!!

i was filling a form moments ago. it had options for correspondence and permanent address. I filled the correspondence address and then there was an option to tick if both address are same. i checked it and permanent address was filled with same data as in corresponding address. i am thinking how it is done. i thought about view state and stuff but there is not postback so don't think view state was used. then i gave a thought to data table - may be... don know.

can anybody give me some advise how it can be done ???
Posted

one option can be that postback is happening under update panel...
by the use of javascript on the tick event of check box...

post here if any more help needed
 
Share this answer
 
<asp:checkbox id="chkInterest1" runat="server" text="Correspondence" onclick="alert(this.checked)" />

This will raise a client side event when a checkbox is checked,You can call your own javascript function. In that function you can set the value of one control to other.

Refer below link for a sample
http://doitdotnet.wordpress.com/2011/12/16/handling-checkbox-checked-change-event-in-client-side/[^]

Thanks
 
Share this answer
 
v3
You can do that thing using Jquery also using below code.Before used below code make sure you are add reference Jquery Script.

$(document).ready(function() {
$('#checkboxid').click(function() {
$('#textboxSecondid').val($('#textboxFirstid').val());
});

});
 
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