How do I add dynamic check boxes inside a detail table

Hi

We have a requirement to add dynamic check boxes inside a detail table’s column. The issue is that when we add the check boxes and assign them IDs from the Design tab, all the IDs for all the rows are then all the same when see from the Preview. How can we add these check boxes in a detail table and still be able to target every check box in every single row to set their values and other CSS properties?

Can this be done in OL Connect? Can you please provide a demo template?

Many Thanks,

Steve.

Hello Steve,

You can achieve this using the script below. In this case I’ve assigned the checkbox a class and used that in the selector (e.g. productID). The script iterates over each input and uses the index to retrieve the corresponding data from the detail table. The resulting value is set to the name attribute of the checkbox.

Selector: #yourtable td input.productID

results.each(function(index){    
    var checkboxName = record.tables["detail"][index].fields["ItemNumber"];
    this.attr('name',checkboxName);
});

When submitting to Workflow you might consider setting the value attribute rather than the name attribute. This way the checkboxes are easier to identify and parse in the xml job data.

Hope this is of some help,

Erik