Hello,
I am working on a customization and would like some information on how the $countries variable logs the value of the select dropdown in the front end.
Basically, I am trying to use jQuery to either hide or show an element on the Add Events page – based on the value of the country selected in the Country dropdown…
The code I am using here:
<script> $(‘select[name=venue[Country]]’).change(function () {
if ($(this).val() == ‘Canada’) { $(‘#StateProvinceSelectCAN’).show();
} else { $(‘#StateProvinceSelectCAN’).hide();
}
});
</script>
However, this script is not working. I was wondering what the proper value structure is for the $countries array, is it
[0] – starting at “Select a country:”
[1] – “United States”
[2] – “Afghanistan” …. etc
Or are the values the:
“US”
“AF”
“AL”
I have tried to manually count out the numerical value for ‘Canada’ in the list which is 39 or 40, and tried this method to no success – Ive also tried “Canada” as the value in my jQuery script – with no success either.
Any help on this issue would be greatly appreciated.
Thanks