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

Question

Question

Field rules not applying until after form load

asked on February 28

We have several forms that are set to be accessible during certain times of the year.  To avoid having too manually adjust show/hide fields or disable the form, I use field rules to display Custom HTML messages or show the fields that are available to complete based on specific triggers in the form and/or the current date.  We also use this setup to prevent users from completing an external form more than once. 

In testing, I noticed that the messages and fields that are set to show based on field rules, show immediately when the form starts to load for less than a second, then the field rules take effect to keep them hidden until something on the form triggers them to show.  I tested this in the classic designer and the rules take effect immediately which is what I would expect.  Is this an issue with Modern designer?

I built a very basic test with one field rule and no look up rules to make sure nothing was interfering with the rules, and I got the same result.

Laserfiche Forms Professional Version 11.0.2311.50564  

0 0

Answer

SELECTED ANSWER
replied on March 1

This is definitely a notable difference between the form designer and classic forms. Classic forms waits to render the page until all initial field rules and lookup completes. This may look fine for simple forms, but in complex forms or if there are any delays in the lookups it dramatically increases the first paint of the form.

In the new form designer we explicitly do not wait for anything before painting the page which in your case leads to some blips in show/hide logic, but more commonly is a better user experience. 

I think a middle ground we could do is to better establish the initial state of fields from field rules based on the form's static (default) values. So in your case the field would default hidden because it relies on the value to be "Show" but the static value is undefined. We would of course not touch on load lookup rules and any field rules affected by lookup rules would not see any changes.

You could control could do now though is to control what is shown yourself with CSS or JS. If all of your fields should be hidden by default you can hide them with CSS and remove the class in JS. Another thing I have done before is use custom html in the form description to show a loading bar and wait for a series of lookups to complete before populating the form.

An example hidden CSS class that doesn't hide the element in the designer is:
 

.hidden {
  display: none;
}
.hidden:has(.selectors-display) {
  display: block;
}
.hidden:has(.selectors-display):after {
  content: "hidden";
  position: absolute;
  top: 0;
  right: 0;
  border: 1px dashed gray;
  background: lightgray;
  padding: .5rem;
  border-radius: 4px;
}

 

1 0
replied on March 3

Thank you, Zac.  The reason now makes sense.  I was already using JS to validate when lookup rules were complete.  I added the CSS you provided on the fields that need to be hidden based on an initial lookup completing and it works perfectly.  

3 0

Replies

replied on February 28

I've noticed this behavior too, and wish it resolved those rules before displaying the items.

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

Sign in to reply to this post.