This file contains 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
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(); |
This file contains 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
//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(); | |
}); |
This file contains 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
// 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"); |
This file contains 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
$(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() { |
This file contains 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
$(document).ready(function() { | |
var phoneLabel = $('label[for="subscription_customer_attributes_phone"]'); | |
phoneLabel.text(phoneLabel.text() + " *"); | |
}); | |
var form = $("form:first"); | |
var phone = $("#subscription_customer_attributes_phone"); | |
var submitBtn = $("#subscription_submit") | |
submitBtn.click(function(){ |
This file contains 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
function hideRecurringLineItem() { | |
$('#summary-recurring-charges').hide(); | |
$('.plan__summary-component').hide(); | |
}; | |
$(document).bind("afterSummaryRefresh", hideRecurringLineItem); |
This file contains 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
// Just put what you want the setup fee text to be in the PLACE TEXT HERE placeholder | |
function changeSetupFee() { | |
var setupfee = $("#summary-setup-fee .plan__summary-table-row-label"); | |
var text = setupfee.text().replace('Setup Fee', 'PLACE TEXT HERE'); | |
setupfee.text(text); | |
}; | |
$(document).bind("afterSummaryRefresh", changeSetupFee); |
This file contains 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
// CONFIGURE YOUR PLAN | |
$('.form__section--configure-plan h3').html("CONFIGURE YOUR PLAN"); | |
$('#form__section-apply-components').html("UPDATE TOTALS"); | |
$('#form__section-apply-components').data("loading-text", "<i class='fa fa-refresh fa-spin fa-fw'></i> UPDATING..."); | |
$('#form__section-apply-components').data("button-text", "UPDATE TOTALS"); | |
// COUPON CODE | |
$('.form__section--coupon h3').html("COUPON CODE"); | |
$('#coupon_button').html("APPLY CODE"); | |
$('#coupon_button').data("loading-text", "<i class='fa fa-refresh fa-spin fa-fw'></i> APPLYING..."); |
This file contains 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
// Replace the values in `fieldLabel` and `field` with the field you want to add validations too. | |
// This example shows how you would require Organization. | |
$(document).ready(function() { | |
var fieldLabel = $('label[for="subscription_customer_attributes_organization"]'); | |
fieldLabel.text(fieldLabel.text() + " *"); | |
}); | |
var field = $("#subscription_customer_attributes_organization"); | |
var form = $("#signup-form"); |
OlderNewer