How to require a field based on Age

How to require a field based on Age

Overview

Some communities require fields based on age.  Examples include...
  1. Require a Picture for children over 12.
  2. Require Proof or Residency for any adults over 21.     

Here is how 

In the Hide/Unhide Calculation, use the following formula:
  1. (dateStr(sibling("patronBirthDate")) != "") && (age(sibling("patronBirthDate")) < X)
  2. Where X is the age. 
  3. Operators <, <=,  >, or >= can be used.  
Example: (dateStr(sibling("patronBirthDate")) != "") && (age(sibling("patronBirthDate")) < 12)

This example will hide the image is the DOB entered calculates an age less than 12 years old.