Hi,you can use this
function Test() {
var chk = document.getElementById('<%= chk.ClientID %>');
var txt = document.getElementById('<%= txt.ClientID %>');
if (chk.checked)
txt.value = chk.value;
}
Call this function on ASP.net button's OnClientClick event