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

Question

Question

Relabel column header in table in new forms designer

asked on January 26, 2024 Show version history

As I am typing this it seems like a dumb question, but I am not seeing column headers in the JS documentation provided by Laserfiche. Anyone been down this road already?

I have the variable I need relabeling a non-column label and works great. Now I'm trying to set it on the column. I can't just change the ID.

Thanks!

//Change label on day of week to include date
LFForm.onFieldChange(function(){LFForm.changeFieldSettings( {fieldId: 45}, {label: LFForm.getFieldValues({fieldId: 50})} )}, {fieldId: 50});

0 0

Replies

replied on January 29, 2024 Show version history

Hi Chris, this code will change the label of a field based on the value input into another field.

My input Value was Field 4, My field label to change is field 5.

 

 

If you use Blur, the Field Label will change once you leave the field (4)

LFForm.onFieldBlur(function(){ 
  LFForm.changeFieldSettings({fieldId: 5}, {label: LFForm.getFieldValues({fieldId: 4})}) }
, {fieldId: 4});

 

If you use Change, the Label will change as you type into Field (4). Every character input into a field is seen as a change in the Layout Designer.

LFForm.onFieldChange(function(){ 
  LFForm.changeFieldSettings({fieldId: 5}, {label: LFForm.getFieldValues({fieldId: 4})}) }
, {fieldId: 4});

1 0
replied on January 29, 2024 Show version history

Thanks Steve! I can get that far. But can you get it to do that on a column header label  in a table? That is the real question :)

It mentions that it can do that in the help documentation. 

0 0
replied on January 29, 2024

It works the same in a Table. All I did was change the target field to the FieldID of Column 2 in the Table
LFForm.onFieldBlur(function(){ 
  LFForm.changeFieldSettings({fieldId: 8}, {label: LFForm.getFieldValues({fieldId: 4})}) }
, {fieldId: 4});

See picture below

1 0
replied on January 29, 2024

Thanks, none of this is working. Are you on Update 5 by chance? I'm on 4.

 Laserfiche Forms Professional Version 11.0.2307.40547

0 0
replied on January 30, 2024 Show version history

I tested it on Laserfiche Forms Professional Version 11.0.2311.50553 (Update 5) and it worked as expected. I don't have an older system to try against.

 

1 0
replied on January 30, 2024

I will be updating my Dev to Update 5 tomorrow morning, so we'll see if that is the culprit. 

0 0
replied on January 31, 2024

Yep, that was it. It needs to be Forms 11 Update 5:
https://answers.laserfiche.com/questions/205547/Modern-Designer-field-label#215343

Thanks for the assist sir!

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

Sign in to reply to this post.