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

Question

Question

Forms Custom HTML buttons not working

asked on October 9, 2023

Hello, I had a couple custom HTML elements that were buttons with URL Links attached to them.  They were working a couple weeks ago but now they only work in the designer pane but won't work when previewed or when the form is assigned.

 

Here is the HTML:

<button title="button title" class="action primary tocart" onclick=" window.open('https://app.laserfiche.com/forms/AP-Table-Sync', '_blank'); return false;">Run Sage Sync Process</button>

 

Can anyone tell me why this is broken all of a sudden and how I might fix it?

0 0

Answers

APPROVED ANSWER
replied on October 13, 2023 Show version history

Fixes for the two mentioned issues have been deployed.

1 0
SELECTED ANSWER
replied on October 10, 2023

I opened a support ticket and Laserfiche has suggested as a workaround for now, you can convert the HTML button element to a tag that's styled as a button and use that instead. I think this means switching "Window.open" to a "href". I did a quick test and href does still work but even though I had set my target to open a new tab, it would open the URL in the opened Task window. I had to right click on the link and choose open in new tab to get it to open a new tab.
 

LF makes it sound like they will address this, but no timeline provided. Hopefully soon.

0 0

Replies

replied on October 10, 2023

Not sure why it suddenly stopped working but I see the type is missing in the params.

type="button"

This has been required for some time to prevent custom buttons from acting as the primary submit button for the form.

0 0
replied on October 11, 2023

In modern forms, when using custom HTML and a button element, you no longer need to set the attribute, type=button. This was only needed when using classic forms and to prevent the custom button from submitting the form.

1 0
replied on October 10, 2023

Ran into the same issue and found that LF was blocking popups in Forms and Tasks. Changing your local browser setting has no effect as these run in a sandbox. It appears the change was part of the Laserfiche Cloud rollout in Oct as we were fine up to the change. I'm trying to figure out how to change the HTML to allow for popups but no luck yet. Hopefully LF will respond to this.

0 0
SELECTED ANSWER
replied on October 10, 2023

I opened a support ticket and Laserfiche has suggested as a workaround for now, you can convert the HTML button element to a tag that's styled as a button and use that instead. I think this means switching "Window.open" to a "href". I did a quick test and href does still work but even though I had set my target to open a new tab, it would open the URL in the opened Task window. I had to right click on the link and choose open in new tab to get it to open a new tab.
 

LF makes it sound like they will address this, but no timeline provided. Hopefully soon.

0 0
replied on October 11, 2023

Sounds good thanks for the response Steve

0 0
replied on October 11, 2023

FYI, from Laserfiche
Two bugs have been identified: 1. Custom HTML buttons that open a new window no longer work from modern forms as the new sandbox environment doesn't allow popups 2. Custom HTML links ("a" elements) have the "target" attribute stripped from it, which prevent links from opening in a new tab

0 0
APPROVED ANSWER
replied on October 13, 2023 Show version history

Fixes for the two mentioned issues have been deployed.

1 0
replied on June 12, 2024

@████████I'm running into this issue after the recent Cloud update and found this thread, hopefully it's an easy fix and/or you remember what caused it back in October? Links are working in the Classic Designer layout pane but not in preview or in the form itself. Modern Designer works fine.

0 0
replied on June 12, 2024

Hi Sarah,

Can you clarify in full detail what issue you're encountering with classic forms in Laserfiche Cloud?

I tested with a classic form that has a custom HTML field using

<a href="https://www.google.com" target="_blank">Click Here</a>

and that link works fine in the classic form designer, preview, and when actually starting the process.

Regards

0 0
replied on June 12, 2024 Show version history

The coding you provided is working for me as well, however the coding that was working for me last week has stopped functioning. On hover, the URL shows at the bottom of the page, however when clicked nothing is happening (except when in the Layout pane, it works perfectly there).

This is the coding I was using:

<a href="https://www.google.com" target="_blank"><button style="color:black;background:radial-gradient(#FFFFFF,#E1FF9CD9);border-color:#65CD57;border-radius:5px;width:175px;height:85px;">Test Button</button></a>

If I recode everything to match the format used by Grant, that works as well. The strange part to me is that my coding was working (and is still functioning in the Modern Designer), but it has stopped working in the Classic Designer.

I have a "form" that is essentially a dashboard for our Finance Department, which has buttons to link to each form they might need to access for ease of use. Thankfully I built it in both designers so I was just able to swap it out for the time being, but in this case I prefer the classic as I can rename the browser tab so it doesn't just show as New Submission.

0 0
replied on June 12, 2024

We have not touched anything related to how that HTML link should be clickable. My thinking right now is a browser update may have stopped this from working since you said it did work before. A couple of notes though.

  1. nesting a button within an 'a' element is not valid HTML according to this spec
  2. this would work despite being invalid if the button had type="button". On my classic designer reproduction clicking this button is actually just submitting the form

You should move your styles to the 'a' tag and make use of bootstrap's btn class to get the behavior you want:

<a
  href="https://app.laserfiche.ca/forms/cDj6k"
  target="_blank"
  class="btn"
  style="display:flex; align-items: center; justify-content:center; color:black;background:radial-gradient(#FFFFFF,#E1FF9CD9);border-color:#65CD57;border-radius:5px;width:175px;height:85px;"
>
Test Button
</a>

 

1 0
replied on June 12, 2024

So bizarre! I'll make those adjustments and see how I do, thank you for the tips.

1 0
replied on September 26, 2024

Hello, I am trying to use HTML custom fields in the LF Forms Modern designer to create a button that will call a JS function.

I think I get it probably wrong, but I am not able to have the button displayed, it would only display the HTML code. I also tried to create a hyperlink instead, but same problem, all that is displayed is the html code.

Any idea what may be wrong here ?

You are not allowed to follow up in this post.

Sign in to reply to this post.