Are you setting the groups in a people picker, or in another field?
If you get the user group names from a people picker you can query the users from multiple groups like this:
var emails = [], groups = getFieldValue("NameOfYourPeoplePickerField");
jQuery.each(groups,function(i,g){
var ugr = spjs.dffs.getUserCollectionFromGroup(g);
jQspjs.each(ugr,function(k,uo){
emails.push(uo.email);
});
});
var useThisInToField = emails.join(";");
Replace “NameOfYourPeoplePickerField” with your field name.
Alexander