How can I write the character count to a single line field in order to prevent submitting unless they have the correct amount of characters? I am using this script, but it writes to the console and the subtext, not a field.
const charCount = LFForm.findFieldsByFieldId(1)[0];
LFForm.onFieldChange(async (e) => {
const count = LFForm.getFieldValues(charCount);
console.log(count);
await LFForm.changeFieldSettings(charCount, { subtext: `Character Count: ${count.length}` })
}, charCount)