Conditionally Display/Hide Data Element on a Donation Form
Does anyone have any experience conditionally showing/hiding a data element on a donation form based on a decision made on another data element?
For example: if someone can choose a from a list of items as a benefit (shirt, hat, water bottle)-- if they choose hat, a question about hat size is displayed; if they choose shirt, a question about shirt size; if they choose water bottle, no additional questions display.
For example: if someone can choose a from a list of items as a benefit (shirt, hat, water bottle)-- if they choose hat, a question about hat size is displayed; if they choose shirt, a question about shirt size; if they choose water bottle, no additional questions display.
Tagged:
0
Comments
-
There a few things here to be aware of. First, create all questions on the form and set them to "NOT REQUIRED" (this is important because you can not require a question that may not be answered because it is not showing). Second hide the secondary question(s) with CSS or JavaScript on load (best to use jQuery $(document).ready). Hide the rows based on some identifying feature (look for a unique row name or elements and use this to navigate to the main container holding it (div or row). Third, add an event handler to the primary question that when changed shows or hides the secondary question to achieve the desired outcome.0
-
Also bear in mind you may need similar hide/show logic for question answers on the thank you page and autoresponder. You can conditionalize this logic based on values being present or not.0
-
This thread talks about this:
https://community.blackbaud.com/forums/viewtopic/1/541320 -
Or here is something similar in jQuery.
<style>
#tribute_honoree_name_row {display: none;}
</style>
<script>
jQuery(document).ready(function ($) {
var tributeChange = function () {
if( $("#tribute_type").val() == "tribute_type_value1") {
$("#tribute_honoree_name_row").show();
$("#tribute_honoree_namename").focus();
} else {
$("#tribute_honoree_name_row").hide();
}
};
$("#tribute_type").on("change", function() { tributeChange (); });
});
</script>0
Categories
- All Categories
- New YourCause Community TEST
- New SKY Community TEST
- New Grantmaking TEST Community
- New Altru Test Community
- New bbcon Community - TEST
- 12 Blackbaud Agents for Good™
- New Raiser's Edge NXT Community
- 7 Blackbaud Community Help
- 218 bbcon®
- 1.4K Blackbaud Altru®
- 409 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.2K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 16 donorCentrics®
- 361 Blackbaud eTapestry®
- 2.7K Blackbaud Financial Edge NXT®
- 680 Blackbaud Grantmaking™
- 598 Blackbaud Education Management Solutions for Higher Education
- 3.3K Blackbaud Education Management Solutions for K-12 Schools
- 952 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 85 JustGiving® from Blackbaud®
- 7K Blackbaud Raiser's Edge NXT®
- 3.9K SKY Developer
- 257 ResearchPoint™
- 123 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 247 Member Lounge (Just for Fun)
- 40 Blackbaud Community Challenges
- 37 PowerUp Challenges
- 3 (Closed) PowerUp Challenge: Grid View Batch
- 3 (Closed) PowerUp Challenge: Chat for Blackbaud AI
- 3 (Closed) PowerUp Challenge: Data Health
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Product Update Briefing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports+
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Email Marketing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Gift Management
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Event Management
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Home Page
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Query
- 822 Community News
- 3.1K Jobs Board
- 57 Blackbaud SKY® Reporting Announcements
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)
