Chodzi o to aby zaznaczając wybrane checkbox'y, wartości z nich dodawały się do pola input typu tekstowego.
<input type='checkbox' id="1" name='my_checkbox1' value='asd'> <input type='checkbox' id="2" name='my_checkbox2' value='zxc'> <input type='checkbox' id="3" name='my_checkbox3' value='fds'> $(document).ready(function(){ $(":checkbox").change(function(){ if($(this).attr("checked")) { var str = ""; $("input").each(function () { str += $(this).val() + " " }); } else { var str = ""; } $(":text").val(str); }); });
Udało się rozwiązać

<!DOCTYPE html> <html> <head> <style> div { color:red; } </style> </head> <body> Karol <input type='checkbox' value='Karol'> Zofia <input type='checkbox' value='Zofia'> Adam <input type='checkbox' value='Adam'> <input type="text" id="pole" value=""/> <script> $("input").click(function () { var str = ""; $("input:checked").each(function () { str += $(this).val() + " "; }); $("#pole").val(str); }) </script> </body> </html>