Last active
December 6, 2016 15:42
-
-
Save jebaird/6870bc32a5ddb6f5cb3f to your computer and use it in GitHub Desktop.
Hides all but the Australian states in the state field for ONTRApages. Only works for chrome and firefox, ie doesn't support hiding options via css. Just drop this gist into the custom header code textarea in the settings tab
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
/* hide all options in the state field */ | |
select[name="state"] option { | |
display: none; | |
} | |
/* target the states we want to show via the value attribute */ | |
select[name="state"] option[value="ACT"], | |
select[name="state"] option[value="NSW"], | |
select[name="state"] option[value="VIC"], | |
select[name="state"] option[value="QLD"], | |
select[name="state"] option[value="AU_NT"], | |
select[name="state"] option[value="AU_WA"], | |
select[name="state"] option[value="SA"], | |
select[name="state"] option[value="TAS"], | |
select[name="state"] option[value=""], | |
select[name="state"] option[value="_NOTLISTED_"], | |
select[name="state"] option[value="ACT"] { | |
display: block; | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Kevin Eales Monroe mentioned to me that a similar block of CSS is needed to set the states for the billing country as well: