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

Question

Question

How to Hide Field with Field Rules Condition from Repeatable Table?

asked on September 9, 2014 Show version history

I have a field rule that is set to hide 6 Custom HTML fields when any 23 of 433 drop down options are selected. When I preview the form though, it does not behave as expected. When any one of those 23 options are selected, it does not hide any of the Custom HTML fields.

 

UPDATE: I updated the topic to reflect the real issue at hand.

1 0

Replies

replied on September 9, 2014

From what I can tell, the issue comes because the field I am using for the "Is" or "Is Not" is in a table. If I try it with a drop-down field out side of a table it works correctly. Is this a known issue?

2 0
replied on September 9, 2014

So you got it working with my suggestion?

 

Hm....the whole thing about the table makes it possible that you have found one of the things known not to work when using a table. I would assume this is a repeatable table that is the problem, and in that case, is it working on the first row but not the subsequent rows? 

0 0
replied on September 9, 2014

No, it does not work at all. Doesn't matter which row it is in the repeatable table. I'm opening a support case with our VAR to see if they can get some information from Laserfiche on the problem.

2 0
replied on September 9, 2014

Please let the community know when you hear more. I am interested to understand exactly what it is. I have not used hide rules with tables in a while, so I may not be the best source. I would recommend giving my original idea of using javascript though a chance as it would be able to handle the repeatable table easily

0 0
replied on September 9, 2014

I have found the same issue on several forms, not necessarily when hiding HTML fields, but with any other fields. We've used workarounds and JS to deal with these situations.

0 0
replied on September 9, 2014

Not sure why that happens but I would just go ahead and do it in Javascript. If you add the same CSS Class to all these dropdowns, and you make one dropdown hidden that has all these options, you can set up a Javascript function to run whenever these dropdowns change and compare that changed dropdown to all the options in the hidden dropdown field and if it finds a match, it hides the HTML fields you want. You can likely do that also by having all HTML fields have the same class assigned to them

0 0
replied on September 9, 2014

Are you saying you have the same problem or you just don't know why it happens to mine?

1 0
replied on September 9, 2014 Show version history

I have never attempted the same type of thing with hiding Custom HTML fields, but I was offering a solution that would circumvent the built in functionality in a way that you would accomplish the task at hand and avoid the issue you are facing. 

 

I would recommend however to first try some other type of field and remove all the custom fields from that rule. If it isn't working on a regular field, then you have simply set the rule improperly.

 

I usually set things to "Show" and would change that from "is" to "Is not" since originally. If you give that a try, you need to change that to "All" instead of "Any" so that it would be logically correct

0 0
replied on September 9, 2014

Changing from "is" to "is not" is not an option. I would have to add 410 items as "is not" compared to 23 items with "is".

1 0
replied on September 9, 2014

did you read the rest of that recommendation?

 

If you can make a copy of the form, or just do it on that one, make the following changes:

  1. All 6 fields that are "Hide" should be changed to "Show"
  2. Change "Any" to "All"
  3. Change all 23 comparisons that are "is" to "is not"

 

That logically is reversing the logic you are trying to give it in the screenshot, so it would still be fine.

 

Have you taken a look at the other suggestion about testing it with hiding just 1 regular field to ensure it's not the HTML fields causing the problem?

 

0 0
replied on September 10, 2014 Show version history

Here you go, this is fully working if you do it like this. Just add some CSS class and hide it to the fields I use to make it all clean. I use a view field, current field and Position set to the column in the table. I also use the CSS Class ruleHTML to control which fields hide. Lastly, I had a FilledField field with auto-suggestions listing all the options that should cause the fields to hide. I hope this helps:

$(function() {
    $(document).ready(function() {
		
	    function updateHidden() {
            $('.view input').val('show');
			$('.cf-table-block tbody tr').each(function () {
				var currentField = $(this).find('.Position select').val();
				$('.current input').val(currentField);
				$('.FilledField datalist select option').each(function(){
					if ($('.current input').val() == $(this).val())
						$('.view input').val('hide');
				});
			});
			var currentView = $('.view input').val();
            if($('.view input').val() == 'show') {
                $('.ruleHTML').css('display','block');
            } else {
                $('.ruleHTML').css('display','none');
			}
	    }

		$('.cf-table-block').change(updateHidden);
	});
});

 

 

 

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

Sign in to reply to this post.