1 $("#check").change(function () {
2 if (this.checked) {
3 //I am checked
4 name_val = $('#name').val();
5 $('#player').val(name_val);
6 } else {
7 //I'm not checked
8 $('#player').val('');
9 }
10 });