I have a simple form with one Single Line (A) field, one Table (one row, one column with a Single Line field (B)), and one Section. I am able to show/hide this Section if I setup a Field Rule to hide it when the first Single Line (A) field is empty. The issue arises when I want to use the Single Line (B) field from the Table in the same Field Rule to control when the Section shows/hides. It allows me to create the rule but the rule does not work. Is there a way to use a Field from a table to control when a section is shown/hidden?
Question
Question
Use Single Line Field in Table to Show/Hide Section in Forms 9.1
Answer
There are a couple things going on here. First, there's an known issue with rules that prevents them from working if one of the fields is in a table or collection. Please see this forum post for more information and a workaround to this issue.
Using a table to get fields side-by-side can work in some situations and, if you weren't running in to the known issue, it'd probably be fine. Instead of using a table, you could try using a little bit of CSS to accomplish that, as Abby mentioned. Add a class to several fields, like "myClass" and then enter the following CSS rule on the CSS and JavaScript page:
.myClass {display: inline-block;}
If you go this route, you'll probably want to manually adjust field widths to ensure that they look exactly how you want them to. The instructions for that are also on that page. You can also check out this white paper about using CSS in Forms.
We certainly want to make it easier for users to create form layouts that meet their needs, and that's something we want to improve in future versions of Forms. Until then, these layouts are possible using CSS in conjunction with the Themes page. Please continue to give us feedback and use cases and let us know the places where we can improve.
Replies
I've worked on Forms this way, however I am teaching a non-IT customer how to create Forms on the fly. These customers can create nice looking reports in SSRS or Crystal without needing to know programming and I am hoping that LF Forms follows suit so these customers do not need their IT department involved to put two fields side by side. It would be nice to see something like a grid pattern where the users can drag the fields around the form, thus providing an easier method for customizing their forms.
That is a very interesting use case. I think some of our clients would like this as well (as well as myself). It's a bit annoying that a feature will work some of the time in only certain situations but not in all. If the rules area at least informed you that it would not work it would be better as at least an end user knows it is a limitation from the start. Frankly, Forms is seen by many customers as a low technical know-how tool to use for basic needs and is self contained for simplicity.
If you really want to make this all work, you might want to consider making your own tool and menus for the client that create a XML file for them to import the BP into Forms. At this point you can insert the logic into the XML file and they are none the wiser.
That is a limitation of Forms 9.0 I am not sure if they fixed this in 9.1 or not. What version are you on? I recommend using Javascript to accomplish this task by making it so that on the field change, you change the display options of the section. It is likely the best and easiest way to go about it.
I knew it was an issue in 9.0 but I was hoping it was fixed in 9.1. It doesn't appear to be but hopefully by 9.2 they'll have a built-in solution.
Table contains multiple rows, user input value may be different from each row, so Forms currently doesn't support use fields inside table to show/hide fields outside table.
@Beau, can you provide a use case when "Use Single Line Field in Table to Show/Hide Section" is needed?
I think the answer lies in using the Table for aesthetic reasons as opposed to recurring reasons. In this scenario I am wanting to have the fields be side by side, as opposed to one field per line as is required if we do not nest them in a table, strictly so it looks better on the form. The ideal solution would be allow us to put fields next to each other on a form outside of a table. If that isn't possible then to have another type of table where we can choose how many columns/rows are in it and we can then nest fields in those various cells. This helps to better utilize real estate and eases in data entry as users are accustomed to seeing like fields side by side (e.g. first name next to last name, start date next to end date, City next to State next to Zip Code). Here is a sample table to give a basic idea of what I am hoping to accomplish aesthetically while still having full functionality and access to the values of the fields:
If possible I'd still prefer to have the ability to put fields next to each other without the need of a table but at this point either one would make forms more functional.