I have a drop-down field inside a collection, it lists all of our office locations. The values available in the drop-down are populated by a database lookup. I want the drop-down field by default to automatically select the location where the form initiator works. I have a hidden Single Line field that is populating the form initiator's location from the database.
This is all working great to select the initiator's location for the first record in the collection, but it doesn't work for additional records added to the collection. I'm sure I'm just missing some silly detail.
Does anyone have any suggestion on how to get this to work with all records in the collection?
Here is the code I am currently using:
$('#q59 input').change(function () { var s = $('#q59 input').val(); $('#q31 option').filter(function () { return $(this).html() == s; }).prop('selected', true); });
q59 is the hidden Single Line field where the form initiator's office location is populated from the database, this code triggers after that value is loaded.
q31 is the drop-down field inside my collection that lists all of the possible office locations.