|

Set your country code as default in Caldera forms?

Take for instance, we reside in Nigeria and sell our services to consumers here. So our phone number fields on our forms should naturally read +234 right? Exactly, follow these steps in this post.

Please note it is not advisable to make edits to your theme files directly, always make edits to your child theme instead. You are adding to your functions.php file. To look up your country ISO Alpha 2 format country code, click here.

add_filter( ‘caldera_forms_phone_js_options’, function( $options){
//Use ISO_3166-1_alpha-2 formatted country code
$options[ ‘initialCountry’ ] = ‘NG’;
return $options;
});

THE ISO CODE FOR NIGERIA is ‘NG’

That’s it. Got questions? Comment below.

Featured Image Source: Divi Notes

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.