Streaming live at 10am (PST)

Need help with implementing code on select field


#1

Hey guys,

I need help with auto detecting a country code (for a phone number) into a form.

I have this code for auto detecting the location of the user:

    $.getJSON('https://freegeoip.net/json/', function(json, textStatus) {
        var ip_info = json;

        c = ip_info.country_code;
        $('.country_codes').val(c);
     

    });

I’ve inserted all of the countries and values manually into a select form field, and now I need to add the codes.

Does anyone have experience with this type of matter?

Share link: https://preview.webflow.com/preview/adsverizon?preview=4a977f9f96f1fd62983330005a615bad

live link: http://adsverizon.webflow.io/another-ebook/another-ebook-adsverizon

Thanks!