I've never attempted to use a lookup rule within a collection before, but am running into some issues. Here is the collection I'm currently working with:
The Department field is a drop down field and when a department is selected, it should populate the Director and Deputy Director/Manager's First Name, Last Name, and Email Address fields based on a lookup rule/table. This occurs correctly when there is only collection entry, but when adding another entry via the "Recognize another employee" button, the Department drop down no longer populates the Director and Deputy Director/Manager fields.
I have two hidden fields as part of the collection that contain default text of "Director" and "Deputy Director". These are used to help pull the correct lines from the lookup table, so when the Department drop down and the Director field (hidden) match, it populates the fields for the Director, and a second rule is set up the same way for the Deputy Director/Manager.
By having two lookup criteria, the autofill button comes into play. I do have some CSS and JavaScript in place however to hide the autofill button and automatically select it, which I think might be the cause of my issue. Here is that code:
CSS:
.autofill {display: none}
JavaScript:
$(document).ready(function() { function autofill() { $('.autofill').trigger('click'); } $('.lookupCondition').change(autofill); });
The Department drop down has also been assigned the CSS class of "lookupCondition".
If anyone has any ideas how to get this to work properly/where I went wrong, I would greatly appreciate it! Thanks!