Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

TODOThe Send2CRM client requires only a bare minimum to automatically hook into an HTML form and send submissions. The sample form below meets these requirements.

  1. A unique means of identifying the submission.
    Either the id (“example_form“) or action (“/thankyou“) attributes may be used. The id is preferable and should be unique across all forms.

  2. A flag to indicate which <form> elements to handle.
    The CSS class send2crm-form indicates to the Send2CRM client that it should process this form.

  3. Names on the <input> elements.
    All fields have a name attribute. As with standard form processing, this identifies the fields and allows reliable mapping.

Code Block
languagehtml
<form method="post" class="send2crm-form" id="example_form" action="/thankyou">
  
  <label for="firstName">First name</label>
  <input type="text" name="firstName" />
  
  <label for="lastName">Last name</label>
  <input type="text" name="lastName" required />
  
  <label for="email">Email</label>
  <input type="email" name="email" required />
  
  <label for="company">Company</label>
  <input type="text" name="company" required />
  
  <button type="submit">Submit</button>
  
</form>

Info

If the Send2CRM form submission succeeds standard form submission will continue, in this case POSTing to the /thankyou page. If it fails a validation error will be shown on the form.