APIs & Integrations

Nitsan
Participant

Update country based on country code (phone number form field)

Hi,

 

Our forms contain both country and phone number fields with country code dropdown (the default dropdown field contains countries names) and it feels like the user needs to fill out his country twice.

 

Currently Hubspot doesn't have any solution for this and update the country property based on the country code (phone number form field), but I wonder if there's any coded walkaround for this challenge someone already thought of and implemented.

 

Many thanks,

Nitsan

1 Reply 1
Jaycee_Lewis
Community Manager
Community Manager

Update country based on country code (phone number form field)

Hey, @Nitsan 👋 Thanks for your question. I tried searching for an existing reply that would be a good fit, but didn't find one. 

 

My instinct is there is a JavaScript-based solution, but it may take some testing on your part. Maybe a script that listens for changes in the phone number field and updates the country field accordingly. 

 

You could make a simple test to listen for one specific country code and country in a form submission. 

If you get something up and running, please share what you did. I know it will help our community to see other folks' creative solutions.

 

Best,

Jaycee

 

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes