<form name="tt">
<input type="checkbox" name="a" value="1" onclick="c();">a
<input type="checkbox" name="a" value="2" onclick="c();">b
<input type="checkbox" name="a" value="3" onclick="c();">c
<input type="text" name="b">
</form>
<script>
function c(){
var chkbox=document.getElementsByName("a");
var v="";
for(var i=0;i<chkbox.length;i++){
if(chkbox[i].checked) v+=","+chkbox[i].value;
}
document.tt.b.value=v.replace(/^,{1}/,"");
}
</script>