Are you sure you have only one html input with id='GeselecteerdeOpties' defined in the page? Seems like you have several inputs with same id.
Try updating the input by name attribute:
jQuery("input[name=GeselecteerdeOpties]").val(ids);
Doing so you'll update all GeselecteerdeOpties inputs.