Last active
April 4, 2019 15:53
-
-
Save salsalabs/e6e32735607f99605ae82deb8aa33040 to your computer and use it in GitHub Desktop.
Solution to store an address and an email for In Memory Of (IMO) in a donation page. IMO is split out it its own fieldset and the address and email are moved there.
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
<!-- Solution to store an address and an email for In Memory Of (IMO) in a donation page. | |
See https://gist.github.com/salsalabs/e6e32735607f99605ae82deb8aa33040 for details. --> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
var needIhoEnhancements = $('#need-imo-enhancements'); | |
if (needIhoEnhancements.length > 0) { | |
// Separate the IMO fields into their own fieldset. Easier to decorate that way. | |
var imo = $('strong:contains("in memory of")'); | |
if (imo.length > 0) { | |
$('#honorof legend').html("This donation is..."); | |
<!-- $('strong:contains("in honor of")').parent().remove(); --> | |
$('#honorof').after($('#memory-of')); | |
imo.parent().remove(); | |
$('#memory-of') | |
.append($('input[name=In_Memory_Name]').parent()) | |
.append($('#iho-enhancements').children()); | |
} | |
} | |
}); | |
</script> | |
<div style="display: none;"> | |
<fieldset id="memory-of"> | |
<legend><strong>in Memory of</strong><em> Keep blank if none</em></legend> | |
</fieldset> | |
<div id="iho-enhancements"> | |
<!-- Remove this div if you do not wish to ask for an IMO email Address --> | |
<div class="formRow"> | |
<label for='iho-email'>In Memory Email</label> | |
<input id="iho-email" name="VARCHAR0" /> | |
</div> | |
<!-- End of IMO Email Div --> | |
<!-- Remove this div if you do not wish to ask for a IMO mailing Address --> | |
<div class="formRow"> | |
<label for='iho-address'>In Memory Address</label> | |
<input id="iho-address" name="VARCHAR1" /> | |
</div> | |
<!-- End of IMO Address Div --> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment