fill a checkbox-field via script (multi-options)?

fill a checkbox-field via script (multi-options)?

I tried several hours to fill a multiple field (checkbox with more than one option) with more than one value by script.
Does it work?
I am able to fill the checkbox-field with one option:
form.checkboxfield="value";
but two or more options are not possible:
form.checkboxfield="value1, value2"; does not work - other ways either.

My script should import data from an lookup-field into an checkbox-field with the same options:

if(input.startimport)
{
for each f in Form1
{
for each old_lookupfield p in f
{
// this works, but the second option overides the first one
f.checkboxfield=p.name;
}
}
}