You can use the eformOnBeforeFormParse event for this. You could do something like this:
1. Create a form template chunk with all fixed fields and a placeholder for the dynamically generated check boxes eg.
<form method="post" action="[~[*id*]~]" id="enquiryForm">
<fieldset>
<h3> Contact Form</h3>
<label for="name">Your name: </label>
<input name="name" type="text" eform="Your Name::1:" />
<label for="email">Your Email Address:</label>
<input name="email" type="text" eform="Email Address:email:1" />
<label for="products">Products</label>
[+productCheckBoxes+]
<label for="comments">Comments:</label>
<textarea name="comments" rows="4" cols="20" eform="Message:html:0"></textarea>
<input type="submit" name="contact" id="cfContact" class="button" value="Send This Message" />
</fieldset>
</form>
2.Create and save a separate snippet with the event function that will be used by eForm. This will need to fetches the product names from the database, build the checkboxes and replace the placeholder in the form template. Something like this:
<?php
//snippet 'eformEventsSnippet' - makes function available to eForm
function beforeFormParseFunction( &fields, &templates ){
//some code for retrieving stuff from the database
//....
// let's assume the result is stored in an array called $rows
//build checkboxes
foreach( $rows as $product )
$p .= "<input type='checkbox' name='products[]' value='".$product['id']."'>".$product['name']."\n";
//fill placeholder in form template
str_replace('[+productCheckBoxes+]',$p,$templates['tpl']);
return true; //important !
}
?>
3. Insert both the above snippet and eForm into your page.
[[eformEventsSnippet]]
[!eForm? &formid=`enquiryForm` &eFormOnBeforeFormParse=`beforeFormParseFunction` ...lots of other parameters... !]
I hope you can work it our from here. eForm comes with some documentation and examples about it events. Have a read through that and the above might become a bit clearer. Hope this helps.