• Resolved RSIDev

    (@rsidev)


    Hello All,

    I was wondering if someone could direct me in the right way, I tried the CF Website to try and see how I can change the preferred country.

    I am trying to edit intlTelInput.js and move from US (1) as the preset to ZA (27) (South Africa)

    However editing both intlTelInput.min.js & intlTelInput.js does not work.

    Is there supporting documentation I am missing?

    Any help would be greatly appreciated.

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Andrew Lima

    (@andrewza)

    Hi @rsidev,

    Thank you for using Caldera Forms. I’m sorry to hear about the issue you are experiencing.

    You do not need to edit the JavaScript file and you are able to use a filter to change the default country to South Africa by adding the following code into your child theme’s functions.php file –

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

    I hope this helps and our documentation will be updated to reflect this shortly.

    Please let me know if you have any further questions.

    Thread Starter RSIDev

    (@rsidev)

    Hi Andrew,

    Thanks very much for the update!

    I found that code on Github, should of used functions.php my bad!

    Keep up the great work on the plugin.

    Kind Regards

    Thanks for the snippet! Here’s the list for people who need to find out their code for respective countries.
    wiki

    • This reply was modified 7 years, 9 months ago by lijitimit.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Battling To Change Preferred Country’ is closed to new replies.