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

Question

Question

Custom HTML validation/saving inconsistent on Form

asked on January 8, 2021 Show version history

Most of our customers are government so a lot of our forms have long HTML blocks for policies, procedures, legalese, etc. I've found that when I copy and paste HTML from VS Code into the LF Forms Custom HTML field, sometimes it won't update, even when I click Done on the field, refresh the page, etc.

I've found that formatting the HTML in certain ways helps, like removing line breaks from inside <p> tags, allows it to save sometimes but not always. Sometimes if I just click around in the custom HTML, it will suddenly update after a few clicks. Sometimes if I type in a single character it will update, and then I just have to delete the extra character. Sometimes nothing works and I just have to copy and paste, refresh the page, sign in and out, until eventually something works. This is very frustrating and time consuming. My HTML is linted and validated by VS Code and I just uploaded it to the W3 validator which found no errors...

Is there a way to turn off this validation? Is there something else I'm not understanding about what triggers the update and what rules exist for valid HTML format in Laserfiche that are more strict than the W3 rules?

Either way, having some kind of user feedback about what Forms found wrong with the HTML would be tremendously helpful.

0 0

Answer

SELECTED ANSWER
replied on January 8, 2021

This sounds like something I've run into, and I wouldn't necessarily call this a rule so much as a "quirk" that happens when you have very long forms.

I've run into this a couple times on very very long forms, but it's not something that happens on every form I put together so I think there's more going on.

When a form gets especially long, there's a lot for the designer to load and sometimes it starts misbehaving in ways like this, so I think it's not just the HTML content.

2 0

Replies

replied on January 8, 2021 Show version history

Found the 'issue' in my HTML was a line break right after a tag opener:

When I remove the line break, it validates in Forms correctly. But according to W3 spec, "A line break occurring immediately following a start tag must be ignored, as must a line break occurring immediately before an end tag."

https://www.w3.org/TR/WD-html40-970917/struct/text.html

What other rules do I need to be aware of for LF specifically?

0 0
SELECTED ANSWER
replied on January 8, 2021

This sounds like something I've run into, and I wouldn't necessarily call this a rule so much as a "quirk" that happens when you have very long forms.

I've run into this a couple times on very very long forms, but it's not something that happens on every form I put together so I think there's more going on.

When a form gets especially long, there's a lot for the designer to load and sometimes it starts misbehaving in ways like this, so I think it's not just the HTML content.

2 0
replied on January 11, 2021 Show version history

Adding to my previous post, one thing that's worked for me in the past is to paste the HTML and then wait until I see it update on the actual page behind the editing window to confirm that it "stuck" before clicking anything else.

Not 100% sure you're having the exact same issue as I did, but it sounds very familiar and that is how I workaround that kind of problem on my long forms.

1 0
replied on January 12, 2021 Show version history

Thanks Jason, I didn't reply for a while because my local forms test server went kaput... but I was just able to test some funky (but valid) HTML syntax on a brand new form and worked fine:

    <ul>
        <li>
            List Item 1 </li>
        <li>
            List Item 2</li>
        <li>List Item 3
        </li>
        <li>
            List Item 4
        </li>
    </ul>

Looks like my forms just get mucked up when they get long, like you said. Thanks for the feedback.

Just FYI, the form I was working on that had problems (most recently) had about 50 fields when I was adding the HTML unsuccessfully. Definitely wouldn't call it extremely long, I'm wondering now if there's some issue with posting updates to the DB before some server-side time-out or something for longer forms.

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

Sign in to reply to this post.