Custom Form

Highlighted
New Member
2 0 0

Hey There,

 

I am in the process of creating a form that acts similar to the contact form. I have created my layout and are having trouble with the ID's. I want it to push through a notification on completion like the standard contact form but cannot seem to get it too?

 

Thanks in advance

<div class="page-width">
  <div class="grid">
    <div class="grid__item medium-up--five-sixths medium-up--push-one-twelfth">
      <div class="section-header">
        <h1>{{ page.title }}</h1>
      </div>

      {% if page.content.size > 0 %}
        <div class="rte">
          {{ page.content }}
        </div>
      {% endif %}

      <div class="contact-form form-vertical">
        {% form 'contact' %}

          {% if form.posted_successfully? %}
            <p class="note form-success">
              {{ 'contact.form.post_success' | t }}
            </p>
          {% endif %}

          {{ form.errors | default_errors }}

          <div class="grid grid--half-gutters">
            <div class="grid__item medium-up--one-half">
              <label for="ContactFormName">{{ 'contact.form.name' | t }}</label>
              <input type="text" id="ContactFormName" name="contact[name]" value="{% if form[name] %}{{ form[name] }}{% elsif customer %}{{ customer.name }}{% endif %}">
            </div>
            <div class="grid__item medium-up--one-half">
              <label for="ContactFormEmail" class="{% if form.errors contains 'email' %}label--error{% endif %}">{{ 'contact.form.email' | t }}</label>
              <input type="email" id="ContactFormEmail" name="contact[email]" autocorrect="off" autocapitalize="off" value="{% if form.email %}{{ form.email }}{% elsif customer %}{{ customer.email }}{% endif %}" class="{% if form.errors contains 'email' %}input--error{% endif %}">
            </div>
          </div>

          <label for="ContactFormPhone">{{ 'contact.form.phone' | t }}</label>
          <input type="tel" id="ContactFormPhone" name="contact[phone]" pattern="[0-9\-]*" value="{% if form[phone] %}{{ form[phone] }}{% elsif customer %}{{ customer.phone }}{% endif %}">

          <label for="ContactFormMessage">{{ 'contact.form.message' | t }}</label>
          <textarea rows="10" id="ContactFormMessage" name="contact[body]">{% if form.body %}{{ form.body }}{% endif %}</textarea>

          <input type="submit" class="btn" value="{{ 'contact.form.submit' | t }}">

        {% endform %}
      </div>
    </div>
  </div>
</div>
0 Likes