0

Today I wanted to add a contact form to my webpage, and I chose the Form Builder plugin for its ease of use. So far all went well, and I managed to display the form in the page (not that difficult), but when testing the form I got an undefined error.

As of now I have no idea what is undefined. I checked the code, the fields I use (they are all Form Builder fields, the email and the plain text), and I checked the settings of Form Builder.

Can you guys help me out?

The link to my website: www.evinwijninga.com

The code in the template

<!-- CONTACT FORM -->

{% set form = craft.formBuilder.getFormByHandle('contactForm') %}
{% set tabs = form.fieldLayout.getFieldLayout().getTabs() %}
{% set pluginScripts = craft.formBuilder.pluginScripts(form) %}

<div class="grid-100">
    <h2>How to contact me</h2>

    <form method="post" accept-charset="utf-8" name="{{ form.handle }}" class="formbuilder-form grid-60 prefix-20 suffix-20 {{ form.handle }}" id="{{ form.handle }}" data-parsley-errors-container=".formbuilder-notification"{% if form.hasFileUploads %} enctype="multipart/form-data" {% endif %}>
        <input type="hidden" name="action" value="formBuilder/entries/saveFormEntry">
        <input type="hidden" name="formredirect" data-redirect="{{form.successPageRedirect}}" value="{{form.redirectUrl}}">
        <input type="hidden" name="formHandle" value="{{form.handle}}">

        {% for tab in tabs %}
        {% set fields = tab.getFields() %}

        <fieldset class="{{loop.index}}">
            <legend>{{ tab.name }}</legend>
            {% for field in fields %}
            {% set input = craft.formBuilder.getInputHtml(field) %}
            <div class="grid-100 grid-parent">{{ input | raw }}</div>
            {% endfor %} 
        </fieldset>
        {% endfor %}

        {# Error/Success Messages #}
        {% if craft.session.hasFlash('error') or craft.session.hasFlash('success') %}
        {% if craft.session.hasFlash('error') %}<div class="formbuilder-notification"><p class="error-message">{{ craft.session.getFlash('error') | raw }}<p></div>{% endif %}
        {% if craft.session.hasFlash('success') %}<div class="formbuilder-notification success"><p class="success-message">{{ craft.session.getFlash('success') | raw }}</p></div>{% endif %}
        {% else %}
        <div class="formbuilder-notification"></div>
        {% endif %}

        <button type="submit" class="grid-100">Submit Message</button>


    </form>
</div>

The fields:

enter image description here

and the settings in Form Builder

enter image description here

This is the latest error entry. The timestamp however is different than the time when I tested the form (which was later):

enter image description here

4
  • What's the actual undefined error you're getting? If you check your craft/storage/runtime/logs files, you'll get the error along with the full stack trace.
    – Brad Bell
    Jul 20 '15 at 3:48
  • Hi @BradBell, I added a screen shot of the latest error. However I doubt if that is the right one. Jul 20 '15 at 11:05
  • Yeah, that's un-related. Better to delete the craft/storage/runtime/logs folder, recreate the issue, then look back at the logs again. Will be easier to spot where your issue is, then.
    – Brad Bell
    Jul 20 '15 at 15:18
  • Sadly no error log is written when I recreate the issue @BradBell Jul 20 '15 at 18:11
2

we ran into the same problem. If you remove "admin" on line 12 of /plugins/formbuilder/resources/js/formbuilder-form.js it works.

url = '/actions/' + $(this).children('[name=action]').attr('value');

We couldn't figure out why the path leads to something which is only accessible with admin-rights.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.