Memberstack
Pricing
API
Login
Build for free
Memberstack
Pricing
API
Login
Build for free
Memberstack
Pricing
API
Login
Build for free
Blog/How to Add a Phone Number Field to your Webflow Form (with Country Select)

How to Add a Phone Number Field to your Webflow Form (with Country Select)

This post will teach you how to add a phone number field to your webflow form (with country select)!

Ovidiu·Contributor
|
January 26, 2024·3 min read

How to Add a Phone Number Field to your Webflow Form (with Country Select)

Memberscripts needed:

  1. https://www.memberstack.com/scripts/perfect-phone-number-inputs

Tutorial:

Cloneable:

https://webflow.com/made-in-webflow/website/phonenumber-input

Why/When would need to Add a Phone Number Field to your Webflow Form?

  1. Make it easier for users to fill in their phone numbers without worrying about their country codes.
  2. Reduce friction and improve your users’ experience.

The less friction introduced in users’ experiences, the better – that’s UX 101. If you’re asking your visitors for their phone numbers, a good way to make it as easy as possible and as error-proof as possible for them is to give them a country selector and perhaps even better, to have it pre-filled with their correct country codes.

That’s exactly what we’ll be doing below and – spoiler alert – it’s super easy and quick.

Adding a phone number field to Webflow forms

To add a phone number field to a Webflow form, we’re going to use MemberScript #41 – Perfect Phone Number Inputs. Follow the link to get the code you’ll need to add to your page and watch a video tutorial on how to set everything up.

Setting it up

The first thing you’ll need to do is build out the form itself and style it however you want.

Next up, select the phone number field and add the following attribute to it:

  • ms-code-phone-number=”ca,gb,us”

In our example above, the attribute’s value consists of a list of 3 ISO standard two-letter country codes. These represent the preferred countries that will show up at the top of the list.

You can go ahead and replace those country codes with whatever you think is more appropriate for your target audience and you can also remove some of them or add as many as you like.

Making it work

Now that you’ve got the form set up, all you need to do is add the MemberScript #41 custom code to your page, before the closing body tag.

For this MemberScript, we’ve got two pieces of code, depending on your use case:

  1. Code with IP lookup – this will use users’ IP address to pre-fill their country code (but don’t use this with profile forms, it won’t work well).
  2. Code without IP lookup – this will work well with profile forms and it won’t pre-fill users’ country codes based on their IPs.

Conclusion

That’s everything, you can now go ahead and test your form’s phone number field.

If you want to use our demo project to get you started, just click the image below to add it to your Webflow site.

Blog image

Our demo can help you with adding an auto-formatting international phone number input with a selector, autolocation and preferred countries.

Take me to the Scripts!

Written by

Ovidiu

Contributor

Contents

  • Memberscripts needed:
  • Tutorial:
  • Cloneable:
  • Why/When would need to Add a Phone Number Field to your Webflow Form?
  • Adding a phone number field to Webflow forms
  • Setting it up
  • Making it work
  • Conclusion
  • Take me to the Scripts!

Share

Explore Memberstack

  • All Features
  • Customer Showcase
  • Templates
  • Find Experts
  • Pricing
  • Help Center

Product

  • Full Feature List
  • User Accounts
  • Gated Content
  • Secure Payments
  • API & Integrations
  • Data Tables
  • Memberstack & Webflow
  • Memberstack & Claude Code
  • Memberstack & WordPress
  • Create a new account
  • 2.0 Log in
  • 1.0 Log in
  • Pricing

Learn about Memberstack

  • Showcase
  • Testimonials
  • Why Memberstack
  • Memberstack vs Outseta
  • Memberstack vs Memberspace
  • Memberstack vs Webflow Memberships

Company

  • About
  • Careers
  • Changelog
  • Partnerships(email)
  • Contact Us(email)
  • X
  • LinkedIn
  • "Do Not Sell My Data" Promise

Resources

  • Vibe Coding
  • Templates
  • Components
  • MemberScripts
  • Data Attributes
  • Find Experts
  • Hiring Guide
  • Webflow Slack Community
  • WordPress Slack Community
  • Support Forum
  • Help Center
  • Blog
  • llms.txt (for AI)
  • llms-full.txt (for AI)
AICPA
SOC

SOC 2 TYPE 1

CERTIFIED

GDPR

COMPLIANT

CCPA

COMPLIANT

Privacy PolicyTerms of ServiceCookie PolicySecurity Policy

© Memberstack Inc. 2018 - 2025. All rights reserved.

Memberstack - The no-code membership platform for any website | Product Hunt