Customer "Add New Address" Country Select Changes State/Province

! - addresses.liquid | Inset the below code changes the State/Province field to only be State if in United States and everything else will be Province. Both Label and placeholder will change accordingly.
<script type="text/javascript">
	if( $('#address_country_new').val() == "United States" ){
		$('#address_province_container_new').children('label').text('State').next('div').children('#address_province_new').attr('placeholder','State');
	}
	else{
		$('#address_province_container_new').children('label').text('Province').next('div').children('#address_province_new').attr('placeholder','Province');
	}
	$( '#address_country_new' ).change(function() {
		if( $('#address_country_new').val() == "United States" ){
			$('#address_province_container_new').children('label').text('State').next('div').children('#address_province_new').attr('placeholder','State');
		}
		else{
			$('#address_province_container_new').children('label').text('Province').next('div').children('#address_province_new').attr('placeholder','Province');
		}
	});
</script>

? - This is in order to show only State label/placeholder below when the country: United States is selected and everything else will be Province label/placeholder.

Before script Screen Shot 2019-06-21 at 10.54.59 AM

After script Screen Shot 2019-06-21 at 10.54.15 AM Screen Shot 2019-06-21 at 10.55.44 AM

Leave a comment