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

Question

Question

Uncaught TypeError: LFForm.changeActionButton is not a function

asked on December 19, 2023

I am trying to use LFForm.changeActionButton to change the text of the submission button based on the result of a look up. I get this Uncaught TypeError listed in the title when I load the page. 

 

Here is my code: 

 

LFForm.onLookupDone(function () {
    let parentID = LFForm.getFieldValues({fieldId: 5});
    
    if (parentID == 422624) {
    	LFForm.changeActionButton("Submit", {label: "Close"});
    } else if (parentID == 4229023) {
    	LFForm.changeActionButton("Submit", {label: "Open"});    
    } else {
     	LFForm.changeActionButton("Submit", {label: "No Case Found"}); 
    }
}, {lookupRuleId: 1});

Any suggestions? I copied the code from  Business Processes > Creating a New Form > CSS and JavaScript in the Forms Designer > The LFForm Object document

1 0

Replies

replied on December 19, 2023

What version of Forms are you using?

0 0
replied on December 20, 2023 Show version history

Sorry that would be valuable information! Laserfiche Forms Professional Version 11.0.2307.40547

0 0
replied on December 28, 2023

We support LFForm.changeActionButton API since Forms 11 Update 5  (11.0.2311.50553), you can upgrade to latest version if needed.

1 0
replied on January 2, 2024

Silly question but how do I download the update? If I click on that link and then follow the download link in the summary I get to the right page but the download button is grayed out. Thanks. 

0 0
replied on January 2, 2024 Show version history

You must be logged into the Support Site and have download rights assigned to your account.

0 0
replied on December 20, 2023

Are you using a self-hosted (on premise) version of laserfiche forms? I do know there are some differences in the LFForm object that is supported. However, it seems like that document has disappeared as it used to be here...

https://doc.laserfiche.com/laserfiche.documentation/11/administration/en-us/Default.htm#../Subsystems/Forms/Content/Javascript-and-CSS/JavaScript-in-the-Forms-Designer.htm?Highlight=LFForm

0 0
replied on December 20, 2023

Self-hosted. Yeah I saw a link for that document somewhere and noticed it was no longer valid. 

0 0
replied on December 20, 2023

Yep, would be nice to get it back.

I just went and checked all the available methods on the LFForm object (Laserfiche Forms Professional Version 11.0.2212.31000) and it looks like, changeActionButton isn't a method on it.

1 0
replied on December 20, 2023

Well that explains it. How did you see that? I am assuming its DevTools but how/where were you able to look at the properties of that object? I've done that using breakpoints and view the information when it stops but not sure where I would find this. Thanks!

0 0
replied on December 20, 2023

It's in the console of the browser's devtools

You can console.log an object and see all its available methods, which in this case I just used console.log(LFForm) for the LFForm object. Although, there isn't much more information than that.

1 0
replied on December 21, 2023

Oh yeah duh! Why didn't I think of that frown But thank you!!!

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

Sign in to reply to this post.