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

Question

Question

Show or Hide Fields Based on Age using Collector Field

asked on August 29, 2023

Greetings,

I am about to finish a membership form and I am asked, if a family member is between 16 and 18 years of age, is it possible to show the Legal Guardian Signature field.
To obtain the data of the family members I use a Data Collector Field.
As additional data if it contributes something, the Collector variable is called "Family_Members" and the rest of the variables of the fields inside the collector are called as is the label.
Is it possible to read inside the collector in the Age field and see if the age of any of them is between 16 and 18, show the Guardian Legal Signature field?

 

Thank You. 

 

PS: My current LSF Version is: Laserfiche Forms Professional Version 11.0.2201.20436

family-age.png
family-age.png (49.67 KB)
0 0

Answer

SELECTED ANSWER
replied on August 29, 2023

Hi Luis,

 

You can create a number field outside of your collection and use the MAX function. Then in your field rule, show the signature field when your number field is between 16 and 18.

 

1 0
replied on August 29, 2023

Hi Michelle,

Taking your idea into account, I have done it in another way in the conditions, since they asked me to be specific for ages 16, 17 and 18. So I modified the rule to "if equals" and recreated 3 rules with the associated values .
To avoid more duplicate fields, what I did was transform the age field into a numeric field and so I handled the values directly from it and it has worked perfectly. Thank you for your contribution that helped me a lot to find an immediate solution to the problem. Perhaps this can be done in many ways, but so far your contribution has helped me a lot.

family-age2.png
family-age2.png (37.81 KB)
0 0

Replies

replied on August 29, 2023

How to compare values of a field that is inside a Collector?

I would like to verify if the Age in a numeric field is less than 16 years old, and if it is less, it will show a message as I have achieved in this example:

$('#q74 input').on('change', function() {
     if ($('#q74 input').val() <= "15") {
              alert('Your age is under 16, you must be 16 or older to be a member.');
       $('.Submit').hide();
     } else {
       $('.Submit').show();
     }
   });
  
});

But if more fields are added to the collector, obviously the id of the field changes to #q74(1) or #q74(2), etc, as the number of records within the Collector increases, so that it could check this value in all the variants that the field can have?

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

Sign in to reply to this post.