WordPress text field in array problem

It looks like you may be creating an array around a single long string that needs to be split up into array elements (assuming $idsposts is a string and not an array). Try using

$myposts = explode(",", $idsposts); 

Instead of just adding $idsposts as the only element of your $myposts array.

You can also check if something is an array already using is_array($idsposts).