We worked with a third party for form shortening and now we're at a stage where we need to modify their existing code they setup for us to include an onMatch function for a list of countries, where as if country is a match for any of the ones in our list, the form should expand regardless. They provided us with one country example, but we need to expand it to include others. Does anyone know how we can modify this part of the code so we can include more than just Italy?
if (!window._zi_fc) {window._zi_fc = {}}
window._zi_fc.onMatch = (data) => {
if (data.country == 'Italy') {
console.log('User located in Italy!');
Solved! Go to Solution.
try something like this:
if (!window._zi_fc) {window._zi_fc = {}}
window._zi_fc.onMatch = (data) => {
const fullFormCountries = ["Italy", "Germany", "France"]
if (fullFormCountries.includes(data.country)) {
console.log('User located in a full form country');
Regards
Jo
try something like this:
if (!window._zi_fc) {window._zi_fc = {}}
window._zi_fc.onMatch = (data) => {
const fullFormCountries = ["Italy", "Germany", "France"]
if (fullFormCountries.includes(data.country)) {
console.log('User located in a full form country');
Regards
Jo
(Parenthetically, one wonders why the 3rd party wouldn’t give you a little more help on this, if they developed the code recently!)
@SanfordWhiteman, quite.
I was feeling generous rather than contentious (I know.. strange), so I just gave the answer rather than pushing back. 🙂
Ah, I should have been clearer in that. We worked with them previously to develop it. When reaching out for assistance, no responses, like crickets. So I thought I would try the community to see if anyone else had some insight to help. I know I am reaching at this point, but was hoping for some guidance.