js:
$(function(){ $("input[name='chbox']").change(function(){ var result=""; $("input[name='chbox']:checked").each(function(){ result+=$(this).val()+','; }); if(result!=""){ result=result.substring(0,result.lastIndexOf(',')); } $("#tinput").val(result); }); }) html: <input type="text" id="tinput"/> <div> <input type="checkbox" name="chbox" value="aa"/>aa <input type="checkbox" name="chbox" value="bb"/>bb <input type="checkbox" name="chbox" value="cc"/>cc <input type="checkbox" name="chbox" value="dd"/>dd <input type="checkbox" name="chbox" value="ee"/>ee <input type="checkbox" name="chbox" value="ww"/>ww <input type="checkbox" name="chbox" value="rr"/>rr <input type="checkbox" name="chbox" value="hh"/>hh </div>