Charge Documentation

Required Fields

An optional parameter on the {exp:charge:form} tag to add extra fields to the validation logic to make them required. Separate multiple fields with the pipe character |.

{exp:charge:form
    return="page"
    return_error="error_page"
    plan_amount=10
    required="card_address_line1|member_password|member_username"
    }
    Your form fields
    ..
    <input type="text" name="card_address_line1" value="{card_address_line1}" />
{/exp:charge:form}

Charge Fields

You can make any of the {exp:charge:form} form input fields required. These include fields like card_address_line1, card_address_city, member_password, member_username, and member_screen_name.

To make non-Charge fields required, use meta:.. fields.

meta:.. Fields

Works for any 'meta:..' fields but the field MUST be present on the form with curly braces (i.e. {meta:accept_terms}).

The following code will NOT work because the full meta tag doesn't exist on the page:

{exp:charge:form required="member_password|meta:dogs_name"}
    <input type="text" name="meta:dogs_name" value="" />
{/exp:charge:form}

Here's an example where the full {meta:dogs_name} tag exists in the Charge form:

{exp:charge:form required="member_password|meta:dogs_name"}
    <input type="text" name="meta:dogs_name" value="{meta:dogs_name}" />
{/exp:charge:form}

Here's an example showing how to use the meta:.. field with a checkbox to accept terms and conditions:

{exp:charge:form required="member_password|meta:accept_terms"}
    <label><input type="checkbox" name="meta:accept_terms" value="1" {if "{meta:accept_terms}"}checked="checked"{/if} /> I accept

The tag {meta:accept_terms} must be present exactly like that. You cannot use {if meta:accept_terms} without quotes and curly braces around the meta tag as the code is explicitly checking for {meta:accept_terms}.

Support

Having problems setting up and/or using Charge? Support is offered from 10am to 4pm EST weekdays. Send us an email at help@eeharbor.com and we will respond as quickly as we can.