Skip to content

Instantly share code, notes, and snippets.

View lscoates's full-sized avatar

Luke Scoates lscoates

View GitHub Profile
$(document).ready(function() {
var organizationLabel = $('label[for="subscription_customer_attributes_organization"]');
organizationLabel.text(organizationLabel.text() + " *");
});
var form = $("#signup-form");
var organization = $("#subscription_customer_attributes_organization");
var submitBtn = $("#subscription_submit")
submitBtn.click(function() {
// EXAMPLE of ID in the URL https://subdomain.chargify.com/setup/metafields/1033/edit
$(document).ready(function(){
var customLabel = $("label[for='subscription_metafields_XXX']");
customLabel.text(customLabel.text() + " *");
});
var customInput = $("#subscription_metafields_XXX");
var form = $("#signup-form");
var submitBtn = $("#subscription_submit");
//Limits both Billing and Shipping Countries to the US
$(function() {
$('.form__field--country select').find('option').remove();
$('.form__field--country select').append('<option value="US" checked="checked">United States</option>');
$('.form__field--country select').change();
});
var shipping_only = "You must first specify your Shipping Country"
var billing_only = "You must first specify your Billing Country"
var billing_or_shipping = "You must first specify your Billing or Shipping Country"
var shipping_or_billing = "You must first specify your Shipping or Billing Country"
$('#subscription_customer_attributes_country').change(function(e) {
var error_message = $("#long_vat_message").text();
if ((e.target.value !== "") && ((error_message === shipping_only) || (error_message === billing_or_shipping) || (error_message === shipping_or_billing))) {
hideVatErrorMessage();