Advertisement
oquidave

comma

Aug 20th, 2011
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. $('form input:checkbox:checked').each(function() {
  2. var id = $(this).val();
  3. var div_id = "#tr_"+id ;
  4. contact_id_str += id + ',';
  5. //if last iteration, don't include the comma
  6. });
  7.  
  8. //fintal result should look like
  9. contact_id_str = "1, 2, 3, 4";
  10.  
  11. //instead of
  12. contact_id_str = "1, 2, 3, 4,";//i don't want the last comma
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement