You can use customary Javascript and jQuery methods in the HTML content of your Pages and Page Templates to dynamically change your Donor Point form.  For example the ready() method in jQuery can be used to apply page customizations once the DOM is loaded.  In addition to the standard Javascript and jQuery methods, DonorrPoint includes two methods related to its dynamic form rendering.  


When a constituent interacts with a DonorPoint form, the data they input is sent back to the DonorPoint servers dynamically.  In response DonorPoint may rerender all or part of the form.  For example changing a value on a form may cause other fields to appear or disappear based on those fields' rules for when they are visible.


Because all or part of a form may be rerendered after the form is initially rendered, any customization you make using Javascript or jQuery may need to be re-run after such rerendering.  For example if you change the text or styling of an element, it may be reverted to the DonorPoint default attributes.  If you move an element, you may find a duplicate of the element replace back in its original location in the document.


Two methods are available in DonorPoint pages to call your customization when elements change:


  • ready(descriptor, function(element) {}) - defines a function to be called when an element matching the given descriptor is created
  • observe(descriptor, function(element) {}) - defines a function to be called when an element matching the given descriptor, or elements in its DOM subtree are modified


In each case a single variable is passed to the function containing the element that was created or modified.