asked 20 hours ago
const sourceFieldId = 4;
const customHtmlFieldId = 66;
function updateCollectionHtml() {
const values = LFForm.getFieldValues({ fieldId: 66 });
for (let i = 0; i < values.length; i++) {
const rowValue = values[i] || '';
LFForm.changeFieldSettings({ fieldId: 66, index: i }, {
content: `<a href="https://example.com{rowValue}" target="_blank">View Item ${rowValue}</a>`
});
}
}
// Run when the form loads and whenever the source field changes
LFForm.onFormLoad(updateCollectionHtml);
LFForm.onFieldChange(updateCollectionHtml, { fieldId: 66 });
This worked for calling an outside element inside a collection but I am looking to have each row in the collection have it's own custom html element that displays the contents of the variable. Think if each household has a street adress, I'd like to be able to have a cleaner html field of the street/family names. Or is that limited to a variable an html element?
0
0