Skip to content

Instantly share code, notes, and snippets.

@salsalabs
salsalabs / perpetual_recurring.js
Last active September 12, 2016 22:27
Javascript for perptually recurring donation. See the link for suggestions about CSS for the added disclaimer.
<script type="text/javascript">
$(document).ready(function () {
var term = $('select[name=TERM]');
var disclosure = 'Your recurring donation will be automatically deducted '
+ 'from your account on a monthly basis.';
term.parent()
.after('<input type="hidden" name="PAYPERIOD" value="MONT"/>')
.after('<input type="hidden" name="TERM" value="9999"/>')
.after('<div class="perpetual-disclaimer">' + disclosure + '</div>')
.remove();
<style type="text/css">
.perpetual-disclaimer {
padding: 5px;
width: 500px;
text-align: center;
background-color: lemonchiffon;
color: darkblue;
border: 1pt solid forestgreen;
line-height: 1.2em;
}
@salsalabs
salsalabs / donation_designation_required.html
Last active August 29, 2015 14:01
Script to make the Donation_Designation field required in a donation page. The Donation_Designation field is usually optional, but there are some use cases, particularly when the field is a dropdown, where it needs to be required.
<script type="text/javascript">
$(document).ready(function() {
var required = $('*[name=required]');
var val = required.val();
if (val.indexOf('Designation_Code') == -1) {
val = val + "Designation_Code,";
required.val(val);
}
});
</script>
https://wfc2.wiredforchange.com/save
?xml
&object=email_blast
&_From=The%20Management
&From_Name=The%20Management
&[email protected]
&Subject=Please%20help%20the%20mules!
&query_KEY=44535
&HTML_Content=3Cp%3EHello%2C%20%5B%5BFirst_Name%5D%5D!%3C%2Fp%3E%0A%0A%3Cp%3EOnce%20again%2C%20we're%20asking%20our%20supporters%20to%20reach%20out%20to%20their%20friends%20and%0A%3Ca%20href%3D%22https%3A%2F%2Fwfc2.wiredforchange.com%2Fo%2F8564%2Fp%2Fsalsa%2Fdonation%2Fcommon%2Fpublic%2F%3Fdonate_page_KEY%3D8237%3E%0A%3Ci%3Ehelp%20mules%20around%20the%20world.%3C%2Fi%3E%3C%2Fa%3E%3Cp%3E%0A%0A%3Cp%3ERegards%2C%3C%2Fp%3E%0A%0A%3Cp%3EThe%20Management%3C%2Fp%3E
&Text_ContentHello%2C%20%5B%5BFirst_Name%5D%5D!%0A%0A%3Cp%3EOnce%20again%2C%20we're%20asking%20our%20supporters%20to%20reach%20out%20to%20their%20friends%20and%0Ahelp%20mules%20around%20the%20world.%0A%0A%5B%5Bhttps%3A%2F%2Fwfc2.wiredforchange.com%2Fo%2F8564%2Fp%2Fsalsa%2Fdonation%2Fcommon%2Fpublic%2F%3Fdonate_page_KEY%3D8237%5D%5D%0A%0AThanks!%0A%0AThe%
<p>Hello, [[First_Name]]!</p>
<p>
Once again, we're asking our supporters to reach out to their friends and
<a href="https://wfc2.wiredforchange.com/o/8564/p/salsa/donation/common/public/?donate_page_KEY=8237">
<i>help mules around the world.</i>
</a>
</p>
<p>Regards,</p>
<p>The Management</p>
https://wfc2.wiredforchange.com/save
?xml
&object=email_blast
&_From=The%20Management
&From_Name=The%20Management
&[email protected]
&Subject=Please%20help%20the%20mules!
&query_KEY=44535
&HTML_Content=3Cp%3EHello%2C%20%5B%5BFirst_Name%5D%5D!%3C%2Fp%3E%0A%0A%3Cp%3EOnce%20again%2C%20we're%20asking%20our%20supporters%20to%20reach%20out%20to%20their%20friends%20and%0A%3Ca%20href%3D%22https%3A%2F%2Fwfc2.wiredforchange.com%2Fo%2F8564%2Fp%2Fsalsa%2Fdonation%2Fcommon%2Fpublic%2F%3Fdonate_page_KEY%3D8237%3E%0A%3Ci%3Ehelp%20mules%20around%20the%20world.%3C%2Fi%3E%3C%2Fa%3E%3Cp%3E%0A%0A%3Cp%3ERegards%2C%3C%2Fp%3E%0A%0A%3Cp%3EThe%20Management%3C%2Fp%3E
&Text_ContentHello%2C%20%5B%5BFirst_Name%5D%5D!%0A%0A%3Cp%3EOnce%20again%2C%20we're%20asking%20our%20supporters%20to%20reach%20out%20to%20their%20friends%20and%0Ahelp%20mules%20around%20the%20world.%0A%0A%5B%5Bhttps%3A%2F%2Fwfc2.wiredforchange.com%2Fo%2F8564%2Fp%2Fsalsa%2Fdonation%2Fcommon%2Fpublic%2F%3Fdonate_page_KEY%3D8237%5D%5D%0A%0AThanks!%0A%0AThe%
@salsalabs
salsalabs / remove_amex_and_discover_from_events.html
Last active August 29, 2015 14:02
Script to remove Amex and Discover from the list of valid credit cards for events with fees.
<script type="text/javsacript">
// See: https://salsasupport.zendesk.com/entries/44958284
$(document).ready(function() {
if (/checkout\.sjs\?event_KEY=\d+/.test(window.location.href)) {
$('option[value="amex"]').remove();
$('option[value="disc"]').remove();
}
})
</script>
<p>Hello, [[First_Name]]!</p>
<p>Once again, we're asking our supporters to reach out to their friends and
<a href="https://wfc2.wiredforchange.com/o/8564/p/salsa/donation/common/public/?donate_page_KEY=8237">
<i>help mules around the world.</i>
</a>
</p>
<p>Regards,</p>
<p>The Management</p>
@salsalabs
salsalabs / email_blast_url
Created June 17, 2014 23:04
URL used to send the test email blast in this article:
https://wfc2.wiredforchange.com/save
?xml
&object=email_blast
&_From=The%20Management
&From_Name=The%20Management
&[email protected]
&Subject=Please%20help%20the%20mules!
&query_KEY=44535
&HTML_Content=3Cp%3EHello%2C%20%5B%5BFirst_Name%5D%5D!%3C%2Fp%3E%0A%0A%3Cp%3EOnce%20again%2C%20we're%20asking%20our%20supporters%20to%20reach%20out%20to%20their%20friends%20and%0A%3Ca%20href%3D%22https%3A%2F%2Fwfc2.wiredforchange.com%2Fo%2F8564%2Fp%2Fsalsa%2Fdonation%2Fcommon%2Fpublic%2F%3Fdonate_page_KEY%3D8237%3E%0A%3Ci%3Ehelp%20mules%20around%20the%20world.%3C%2Fi%3E%3C%2Fa%3E%3Cp%3E%0A%0A%3Cp%3ERegards%2C%3C%2Fp%3E%0A%0A%3Cp%3EThe%20Management%3C%2Fp%3E
&Text_ContentHello%2C%20%5B%5BFirst_Name%5D%5D!%0A%0A%3Cp%3EOnce%20again%2C%20we're%20asking%20our%20supporters%20to%20reach%20out%20to%20their%20friends%20and%0Ahelp%20mules%20around%20the%20world.%0A%0A%5B%5Bhttps%3A%2F%2Fwfc2.wiredforchange.com%2Fo%2F8564%2Fp%2Fsalsa%2Fdonation%2Fcommon%2Fpublic%2F%3Fdonate_page_KEY%3D8237%5D%5D%0A%0AThanks!%0A%0AThe%
<script type="text/javascript">
// if user enters text in the Other text field, uncheck the fixed contribution radio buttons
function checkOther(form_in) {
var radioGrp = form_in.amount;
for (i = 0; i < radioGrp.length; i++) {
if (i != radioGrp.length - 1) { //the Other radio button must be the last one in the array
radioGrp[i].checked = false;
} else {
radioGrp[i].checked = true;