Salesforce B2C Commerce 23.5 > Developing Your Site > Legacy Developer Documentation > Site Genesis > SGJC Forms > Developing Forms with Pipelines > Salesforce B2C Commerce Forms Components

Creating a Form Definition

Use a form definition to define the browser form elements, including actions and how they are validated. The form definition provides Salesforce B2C Commerce with rules on how to populate the in-memory data that is rendered on the browser.

The SiteGenesis application comes with a set of form definitions, contained in the forms folder.

  1. Open Studio.
  2. Create a form definition with your storefront's cartridge structure, for example, sendstuff.xml, as follows:
    <?xml version="1.0"?>
    <form>
    	<field formid="catalog" label="forms.sendstuff.010" type="boolean" binding="profile.catalogSend" />
    	<field formid="email" label="forms.sendstuff.011" type="boolean" binding="profile.emailSend" /> 
    	<action formid="apply" valid-form="true" /> 
    </form>

    This form definition specifies the two optional fields as boolean and an Apply button.

  3. Continue with this example: Using Forms in Templates.
X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used. By continuing to use this site you are giving us your consent to do this. Privacy Policy.