Passer au contenu principal
The donation-form widget embeds a fully functional CrowdChange donation form on your website. It can render inline within the page or open as a popup triggered by your own button or link, and it supports a compact basic layout as well as the full layout. New to widgets? Start with the Widgets Overview to add the embed script. CrowdChange donation form widget

Usage examples

Inline donation form

Renders the donation form directly in the page flow.
<crowdchange widget="donation-form"
             fundraiser="1000"
             mode="inline"
             language="en"
             color-primary="#cc0000"
             color-background="#e3ae7a"
></crowdchange>
Replace fundraiser with your fundraiser ID from Step 1 of the overview.
For inline embeds, you can supply your own placeholder by nesting an element marked with data-crowdchange-loading="true" inside the <crowdchange> element. It is shown until the form finishes loading.

A popup needs a trigger — a button or link — to open it. Set target to a CSS selector that matches the trigger.
<crowdchange widget="donation-form"
             fundraiser="10000"
             mode="popup"
             target=".my-donate-button"
></crowdchange>

<button type="button" class="my-donate-button">Donate Now</button>

The basic layout renders a more compact form.
<crowdchange widget="donation-form"
             fundraiser="16"
             layout="basic"
             mode="popup"
             target="#btn-donate-2"
             color-primary="#23990d"
></crowdchange>

<button type="button" id="btn-donate-2">Donate Now</button>

Supported settings

JS SettingElement AttributeDescriptionDefault
widgetwidgetWidget type: donation-form.Required
fundraiserfundraiserThe ID of the fundraiser.Required
modemodeinline or popup.popup
layoutlayoutfull or basic.full
languagelanguageThe language code, e.g. en, fr.en
targettargetCSS selector for the element that triggers the popup.
colorPrimarycolor-primaryCustom primary color.Fundraiser’s theme.
colorBackgroundcolor-backgroundCustom background color.
refSourceref-sourceReference source, used only for reporting.embed