Quantcast
Channel: Adobe Community : All Content - LiveCycle Designer
Viewing all articles
Browse latest Browse all 5571

Make certain fields Required in a repeating subform - checked/validated on preSubmit

$
0
0

I have a form that contains a repeating subform - meaning, there is a single subform (flowed Western) with Binding set to repeat a Min of 1, and Max of 15 (hence dynamic repeating subform).

 

Within the subform are 5 fields (example fields below):

 

First Name

Last Name

Email Address

Age

Gender (Radio button for male/female)

 

If the user enters a value for First Name, then the Last Name, Age, and the Gender radio button should all become "required". Similarly, if first First Name value is empty/null, then the Last Name, Age, and Gender radio button fields should be optional.

 

I understand this can be achieved quite easily if the subform wasn’t repeating:

 

if (!(this.isNull)) { //if First Name field isn't null

          LastName.mandatory = "error";

          Age.mandatory = "error";

          //etc

}

else { //if field is null

         LastName.mandatory = "disabled";

          Age.mandatory = "disabled";

          //etc

}

 

However, how is this achieved in a repeating subform?  If the above script is placed in the repeating subform, it affects ALL repeating rows in the subform group once rendered. Instead, I need it the conditional mandatory status to treated on a unique instance basis (row-by-row).

 

Thanks


Viewing all articles
Browse latest Browse all 5571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>