Greetings, Our organization is working on a form, and we are trying to determine how to set up some javascript to only display states or provinces whenever someone selects a certain country. For example if the US, only US states should only be displayed, if Canada only Canadian provinces, and if elsewhere only a text box for state/province should show. Code below, hope it helps.
I have written my code like this
JS
<script language="JavaScript" type="text/javascript">
function selectCountry(elem){
if(elem.value == "United States" || elem.value == "Canada"){
document.getElementById('BillingStateProvince').st yle.display = '';
document.getElementById('BillingStateProvince').st yle.visibility = '';
return false;
}else{
return true;
}
}
</script>
I have attached the html file.
I have written my code like this
JS
<script language="JavaScript" type="text/javascript">
function selectCountry(elem){
if(elem.value == "United States" || elem.value == "Canada"){
document.getElementById('BillingStateProvince').st yle.display = '';
document.getElementById('BillingStateProvince').st yle.visibility = '';
return false;
}else{
return true;
}
}
</script>
I have attached the html file.
Comment