I currently have two Autofill buttons on my form, both of which I know how to trigger. It looks something like this, where I have classes "lookupCondition" and "lookupCondition2" on the respective fields that should trigger the clicking of Autofill.
$(document).ready(function () { function autofill() { $('.autofill').trigger('click'); } $('.lookupCondition').change(autofill); }); $(document).ready(function () { function autofill2() { $('.autofill').trigger('click'); } $('.lookupCondition2').change(autofill2); });
The problem when I do this is that it causes all other fields in my Form to resist input of any kind. They now blank out as I type.
The fields filled in that autofill2 requires to trigger, are filled in by the first autofill, which causes the second one to automatically click when the first lookup goes off.
I tried instead modifying my code like this, using the specific identifiers of the buttons themselves, but it only triggers the first autofill - however, my fields don't automatically blank out if I type in them.
$(document).ready(function () {
function autofill() {
$('#lookup224').trigger('click');
$('#lookup225').delay(2000).trigger('click');
}
$('.lookupCondition').change(autofill);
});