Cross-domain AJAX Donation Form Example

Example of a basic flexible sustaining donation form implemented in AJAX. Uses jQuery and Convio JavaScript libraries. To use this form, you must:

  1. Replace the api_client.html file with the one from the /api directory on your Convio website.
  2. Edit donation_flexible_sustaining.html reference to ConvioApi.js to point to the /api directory on your Convio website.
  3. On your Convio website, create a donation form using the flexible sustaining template.
  4. On your Convio website, go to Settings/Open API Configuration, check your API settings, and add your remote site to the list of allowed JavaScript domains. Note the JavaScript client distinguishes between  * and (no wildcard), so it is best to add both.
  5. Edit donation_flexible_sustaining.html to replace the values in the hidden inputs for form_id and level_id with the correct values for the donation form you created.
  6. Edit the line in donation_flexible_sustaining.html that instantiates ConvioApiClient to use the correct API Key for your Convio website and the correct path to api_client.html on the web server hosting this page.

Note the form is only intended as an example of how to implement the donation API using AJAX. To adapt it for use in a web site, you will need to add success and error response handling code.

Updated to fix UTF-16 (LE) encoding problem on HTML files.

Required Convio Products:

Convio provides this download as a courtesy and in the hope that it will be useful. This download references or utilizes Convio Open APIs. This download is subject to the terms of the Convio API and Web Services License Agreement.

Download Details

Contributor Convio
Version 0.8  
License Convio API and Web Services License Agreement  
Publish Date September 21, 2011  
File Size 212KB Download
Type Code

Submit a Download

Have a download of your own to share? Join our growing developer community and tell us about it.

Related Documentation

Donation Processing
Create the pixel-perfect, custom donation experience

Client Community

Log in to chat with our clients and partners using APIs and share code snippets