Aggregate values from Multi-select field populated with query-string during function call?

Aggregate values from Multi-select field populated with query-string during function call?

I have a function that works together with a stateless form:

void ReverseDeposit(Payment SelectedDepositGroup)
{
    querystring = "";
    for each Payment in SelectedDepositGroup
    {
        querystring = querystring + "recIDlist=" + Payment.ID + "&";
    }
    openUrl("#Form:ReverseDepositValue?" + querystring, "popup window", "width=600");
}

The stateless form has a Multi-select field that gathers the IDs of the selected records of the Payment form in a view.

How can I aggregate the value of field from each of those selected records and have it populate a field in the stateless form on load?