Skip to content

Instantly share code, notes, and snippets.

@jwebgordon
Created December 14, 2012 14:03
Show Gist options
  • Save jwebgordon/4285662 to your computer and use it in GitHub Desktop.
Save jwebgordon/4285662 to your computer and use it in GitHub Desktop.
JS to show state field when country = USA
<script type="text/javascript">
$(window).load(function(){
$('select[name="country_hubspot__c"]').change(function(){
if($('select[name="country_hubspot__c"]').val() == 'United States'){
$('div.hs_state_field__c').show();
}
else{
$('div.hs_state_field__c').hide();
}
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment