Applying Rules to Tables
I have a rule tied to a drop-down embedded in a tabled that is not triggering properly...
As seen above, when 'Job Title' is selected a message is supposed to appear. If 'Job Title' in any other row other than the last row (regardless of how many rows there are), the rule doesn't trigger.
If the selection is made in the last visual row, then the message appears (see above).
The Rule I'm using is above. What am I missing?
-
var event = form.load;
for (let i = 0; i < ModifyWhat.value.length; i++) {
if ((Boolean(ModifyWhat[i].value)) && (ModifyWhat[i].value === 'Job Title')) {
jobtitlemessage.visible = true;
jobtitlemessage.printable = true;
HowManyDays.visible = true;
HowManyDays.required = true;
HowManyDays.printable = true;
} else {
jobtitlemessage.visible = false;
jobtitlemessage.printable = false;
HowManyDays.visible = false;
HowManyDays.required = false;
HowManyDays.printable = false;
}
} -
Try this code instead of what you have now:
var event = form.load; jobtitlemessage.visible = false; jobtitlemessage.printable = false; HowManyDays.visible = false; HowManyDays.required = false; HowManyDays.printable = false; for (let i = 0; i < ModifyWhat.value.length; i++) { if ((Boolean(ModifyWhat[i].value)) && (ModifyWhat[i].value === 'Job Title')) { jobtitlemessage.visible = true; jobtitlemessage.printable = true; HowManyDays.visible = true; HowManyDays.required = true; HowManyDays.printable = true; } }
Please sign in to leave a comment.
Comments
6 comments