Hi,
From your text I understand you need to change the class each time a country is selected. Am I right?
It would be impossible to add a GUI to the plugin that allows all the pissibilities.
The best thing is that you add a JS function that does that and callit when the country change event is fired.
You have all the details of the event at https://github.com/jackocnr/intl-tel-input/blob/master/README.md#events
All the telephone inputs the plugin creates have the class ‘wpcf7-intl-tel’. So, you can use that as selector.
Hope it helps!
Thank you for the fast reply! Could you please give me an example how to create a condition. If country is US set .phone_us class to the input field. Thank you very much!
Hi,
I would add this piece of JS:
jQuery('.wpcf7-intl-tel').on('countrychange', function(e, countryData){
const usClass='phone_us ';
if(countryData.iso2==='us'){
jQuery(e.target).addClass(usClass);
}
else{
jQuery(e.target).removeClass(usClass);
}
});
Yeah! This one does the trick! Thank you Damiarita!