Ninja Forms – Picking up container div ID not field ID
-
Couldn’t get things working with Ninja Forms, field ID was nf-field-7 but nothing was happening. Had a look and the fields variable was being populated by nf-field-7-container (and only that). Reading the code it looks like it’s been set to populate an array with all fields that start with any of the given entries set in Field IDs but is stopping at the first one.
Changed the following lines in simple-address-autocomplete-public.js to get things working. No idea if this will break other installs with different forms/multiple fields that need checking but it fixed this one (change in both was to remove the ^ so it only looked for exact IDs).
Line 43:
fields = document.querySelector(
[id="${inputValues[i]}"]
);Line 54:
const fields = document.querySelectorAll(
[id="${inputValues[i]}"]
);
- The topic ‘Ninja Forms – Picking up container div ID not field ID’ is closed to new replies.