I need to trigger an SQL lookup when a hidden field with a default becomes visible on the form. The hidden field, once no longer hidden, shows a default name for the lookup to check against in order to pull in the format needed for Forms to assign the next task to. The lookup is not triggering.
The hidden field shows up when a radio button choice of "ASB Member" is chosen.
Researching others' posts on this topic, I have found a few pieces to use, but I can't seem to find the right JavaScript combination to get it working. Can someone help me with the exact JavaScript?
- This piece tells it which field needs to behave as if it was just filled in order to trigger the lookup: ... $("#Field61").trigger('change'); I'm assuming to be placed right after: $(document).on('ready', function() { but I believe it's not working because the field is hidden when the form first loads.
- This piece I found along with comments that indicated to me that lookups will not work on hidden fields unless this piece is used? ... function requiredfilled() ... { ... return _.every($('li:has(.cf-required):visible input,li:has(.cf-required):visible textarea'), function(elm) {return $(elm).val() != '';}); ... }