Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
I have a form that when you click a button it repeats an instance of a subform.
I have also added an additional 'validation' button so that it checks that some of the fields in the subform are filled in. I have used some JavaScript for this. The validation works fine on the first instance. However, it does not work on the second instance on the subform. I know that somehow I must get the script to check for extra instances but I cannot work it out.
You will have to put your code in a for loop where you can get the count of subforms to test. Now that you know the number of times to loop through the for loop, you can access each individual item of the subform using this notation:
Many thanks for your reply. I am new to LiveCycle and picking up things and learning as I go along so I didnt fully grasp where to input the code or if it needs to go into a different event. Would you be able to put your example into context with the validation script I have runnning on the click event of a button in my form.
if ((HigherEducationPage.QualificationSubform.course.rawValue == null) || (HigherEducationPage.QualificationSubform.course.rawValue == "")) {
app.alert("Please enter your course in Section 1 of this form.");