I've been stuck for some time. Trying to make a quick donation widget push donation amount onto a donation form on the next page inside the "Other Amount" field.
The form is embedded in the website and hosted by Blackbaud Online Express and has actions like /?BBGiftAmount= online for fixed gift amounts. However not for custom amounts.
Below is my HTML markup of the form.
<div class="donation-wrapper">
<div class="container ">
<div class="row d-flex align-items-center">
<div class="col-lg-2 title">
<h2>Make a Gift:</h2>
<p>Give Generously</p>
</div>
<div class="col-lg-10">
<form action="https://islamic-relief.com.au/what-we-do/aid-and-development/#become-volunteers" class="form-inline ">
<label class="sr-only">Donation Type</label>
<select class="form-control my-1 mr-sm-2">
<option selected>One Time Donation</option>
<option value="1">Recurring Donation</option>
</select>
<label class="sr-only">Donation Amount</label>
<input value="" class="form-control my-1 mr-sm-2" type="number" placeholder="Donation Amount">
<label class="sr-only">Choose Fund</label>
<select name="BBFund" id="bboxdonation_designation_ddDesignations" class="form-control my-1 mr-sm-2">
<option value="103">Lebanon Disability Centre</option>
<option value="84">Water and Sanitation</option>
</select>
<button type="submit" class="btn btn-primary my-1">Donate Now</button>
</form>
</div>
</div>
</div>
</div>
Also, through Chrome console found where the hosted form is reading actions for "?BBGiftAmount=".
function i(t) {
var p = location.search.replace("?", "").split("&"),
m = BBOX.buildQuerystringObject(p),
s, q, u = false,
o = false,
l = m.hasOwnProperty("bbhideothergifts") && m.bbhideothergifts === "1",
v = m.hasOwnProperty("bbhideotherfunds") && m.bbhideotherfunds === "1",
n = !t || l,
r = !t || v;
if (n && m.hasOwnProperty("bbgiftamount")) {
q = parseFloat(m.bbgiftamount);
f.each(a.find(".BBFormRadioGivingLevelItem .BBFormRadioGivingLevelOther"), function() {
if (parseFloat(f(this).val()) === q) {
a.find(".BBDFormSectionGiftInfo input[data-giftchoice][value='1']").attr("checked", "checked").change();
f(this).attr("checked", "checked").change();
u = true;
return false
}
})
}
if (n && m.hasOwnProperty("bbpledgeamount")) {
q = parseFloat(m.bbpledgeamount);
f.each(a.find(".BBFormRadioPledgeAmountItem .BBFormRadioGivingLevel"), function() {
if (parseFloat(f(this).val()) === q) {
a.find(".BBDFormSectionGiftInfo input[data-giftchoice][value='0']").attr("checked", "checked").change();
f(this).attr("checked", "checked").change();
o = true;
return false
}
})
}
if (l) {
if (u && o) {
a.find(".BBFormRadioGivingLevelItem .BBFormRadioLabelGivingLevelNotSelected").parent().remove();
a.find(".BBFormRadioPledgeAmountItem .BBFormRadioLabelGivingLevelNotSelected").parent().remove()
} else {
if (u) {
a.find(".BBFormGiftChoice").remove();
a.find(".BBFormRadioGivingLevelItem .BBFormRadioLabelGivingLevelNotSelected").parent().remove()
} else {
if (o) {
a.find(".BBFormGiftChoice").remove();
a.find(".BBFormRadioPledgeAmountItem .BBFormRadioLabelGivingLevelNotSelected").parent().remove()
}
}
}
}
if (r && m.hasOwnProperty("bbfund")) {
s = a.find('.BBDFormSectionDesignationInfo select[id*="ddDesignations"]');
if (s.find('option[value="' + m.bbfund + '"]').length > 0) {
s.val(m.bbfund);
if (v) {
s.find('option[value!="' + m.bbfund + '"]').remove()
}
}
}
}