Skip to content

Instantly share code, notes, and snippets.

@apih
Last active May 29, 2017 16:12
Show Gist options
  • Save apih/27204ca99aea53c353b5941939dcef99 to your computer and use it in GitHub Desktop.
Save apih/27204ca99aea53c353b5941939dcef99 to your computer and use it in GitHub Desktop.
JS code for selecting first shipping region if no shipping region is selected yet in OnPay form
<script type="text/javascript">
// Select first shipping region if no shipping region is selected yet
if ($("[name='shipping_region']:checked").length === 0) {
$("[name='shipping_region']:first").prop("checked", true);
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment