You are viewing limited content. For full access, please sign in.

Question

Question

Is there a way to append text below a field in the Modern Designer?

asked two days ago Show version history

I have a solution for appending text below a field in the Classic designer by creating a div element and setting it's parent to the field via JS. Since the modern designer does not allow adding elements or changing parents, is there any way to do this?

The goal is to show the original value of the field after the user selects a new value. These are fields in a table so I can't just add another hidden field to the form below it. I need to append the text directly below the existing field.

0 0

Replies

replied two days ago

Can you use the subtext/textBelow property of a field through the LFForm object help?
https://doc.laserfiche.com/laserfiche/en-us/Content/Resources/BusinessProcesses/Javascript-and-CSS/TheLFFormObject.htm?Highlight=lfform#changeFieldSettings  

 

You can get the current field's text with
 

const formFields = { needsPrevValueField: { fieldId: 15 } };
const prevTextBelow = LFForm.findFields(f => f.fieldId === 15)[0].subtext ?? '';
const defaultValue = LFForm.getFieldValues(formFields.needsPrevValueField);
LFForm.changeFieldSettings(formFields.needsPrevValueField, {
    subtext: `${prevTextBelow} (default: ${defaultValue})`
});

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.