Forum

Thread tagged as: Problem, Error, Forms

Two issues with Perch Forms

I am setting up a few forms on a site, and just want to save all the information to the perch app for later use.

The first is for a competition, where the user uploads a photo and then explains something about it. When I comment out the file upload, all the other information is stored fine, when I put it back in, nothing is saved, none of the user details, etc. Once I successfully uploaded a file to the required directory, but I have not been able to replicate that again. I have checked the filetypes.ini and it is all fine.

<perch:label for="fileupload">label</perch:label><br/>
<perch:input type="file" id="fileupload" accept="pdf jpg jpeg png" label="File" />

That is the code for the submission. All the other inputs are just text/email.

The second form is more of a questionnaire, where the user writes detailed responses to some questions, which we then want to save to perch forms for a potential competition down the track. There are 3 text boxes, and the form submits fine and add's all the details, but only saves about 10 words of the text area response/

<perch:label for="about">Please provide a brief introduction about yourself</perch:label>
<perch:input id="about" type="textarea" name="about" label="About" size="l" required />

That is the code for one of the textareas in the form.

Thanks in advance.

Locky Keaney

Locky Keaney 0 points

  • 4 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

In general to help we need:

  1. The complete template rather than a snippet
  2. Your Diagnostics Report

Sorry about that.

Full Templates (removed classes for readability):

Issue 1

<perch:form method="post" app="perch_forms" id="competition-form">

    <div>
        <perch:label for="fileupload">Upload an Image</perch:label><br/>
        <perch:input type="file" id="fileupload" accept="pdf jpg jpeg png" label="File" />
    </div>

    <div>
        <perch:label for="entry-text">Tell us about the Image</label><br/>
        <perch:input name="entry-text" type="textarea" id="entry-text" label="Entry Text" />
    </div>

    <div>
        <perch:label for="your-name">Your Name</perch:label>
        <perch:input type="text" name="your-name" id="your-name" label="Entrant Name" />
    </div>

    <div>
        <perch:label for="partners-name">Partners Name</perch:label>
        <perch:input type="text" name="partners-name" id="partners-name" label="Partner Name" />
    </div>

    <div>
        <perch:label for="your-email" >Your Email</perch:label>
        <perch:input name="your-email" type="email" id="your-email" label="Entrant Email" />
    </div>

    <div>
        <perch:label for="partners-email">Partners Email</perch:label>
        <perch:input name="partners-email" type="email" id="partners-email" label="Partner Email" />
    </div>

    <div>
        <perch:input id="submit_button" type="submit" value="Enter Now" />
    </div>
</perch:form>

Issue 2

<perch:form id="scholarship-form" method="post" app="perch_forms">

    <div>
        <perch:label for="name">Name</perch:label>
        <perch:input id="name" type="text" name="name" label="Name" required />
    </div>

    <div>
        <perch:label for="email">Email</perch:label>
        <perch:input id="email" type="email" name="email" label="Email" required />
    </div>

    <div>
        <perch:label for="phone">Phone</perch:label>
        <perch:input id="phone" type="tel" name="phone" label="Phone" required />
    </div>

    <div>
        <perch:label for="goals" >What is your goal?</perch:label>
        <perch:input id="goals" type="select" name="goals" label="Goals" options="Pass cadet pilot interview and become an airline pilot, Be a commercial pilot, Fly for fun, Not sure yet" required />
    </div>

    <div>
        <perch:label for="about">Please provide a brief introduction about yourself</perch:label>
        <perch:input id="about" type="textarea" name="about" label="About" required />
    </div>

    <div>
        <perch:label for="why_me">Why should we choose you over the other candidates?</perch:label>
        <perch:input id="why_me" type="textarea" name="why_me" label="Why Me?" required />
    </div>

    <div>
        <perch:label for="training">Have you done any flight training in the past?</perch:label>
        <perch:input id="training" type="textarea" name="training" label="Training" required />
    </div>

    <perch:input type="submit" value="Apply" />

</perch:form>

And the Diagnostic report:

PERCH INFORMATION

Perch: 2.8.32
Production mode: Production (100)
Installed apps: content (2.8.32), assets (2.8.32), categories (2.8.32), perch_blog (5.0), mw_customers (2.1), perch_forms (1.8.3), ltf_contacts (1), ltf_vouchers (1), perch_mailchimp (3.0.1)
DB driver: PDO
DB tables: perch2_blog_authors (3), perch2_blog_comments (0), perch2_blog_index (480), perch2_blog_posts (11), perch2_blog_posts_to_tags (33), perch2_blog_sections (1), perch2_blog_tags (12), perch2_blogs (1), perch2_categories (6), perch2_category_counts (4), perch2_category_sets (1), perch2_content_index (7171), perch2_content_items (1000), perch2_content_regions (108), perch2_forms (4), perch2_forms_responses (44), perch2_mailchimp_campaigns (0), perch2_mailchimp_imports (0), perch2_mailchimp_lists (1), perch2_mailchimp_subscribers (0), perch2_mailchimp_subscriptions (0), perch2_mailchimp_webhooks (1), perch2_navigation (0), perch2_navigation_pages (0), perch2_page_templates (6), perch2_pages (34), perch2_resource_log (1317), perch2_resource_tags (0), perch2_resources (388), perch2_resources_to_tags (0), perch2_settings (30), perch2_user_passwords (0), perch2_user_privileges (41), perch2_user_role_privileges (16), perch2_user_roles (2), perch2_users (2)
Users: 2
App runtimes:
<?php
    $apps_list = array(
        'content',
        'categories',
        'perch_forms',
        'perch_mailchimp',
        'perch_blog'
    );
Scheduled tasks for perch_blog: delete_spam_comments (1440 mins)
Scheduled tasks for perch_mailchimp: import_data (1 mins)
Editor plug-ins: markitup
H1: 421aa90e079fa326b6494f812ad13e79
L1: 3f086b2d471da10d6d4b21741ceefd25
F1: 2edba60ed1f613d6dd804feb202456a2
headerColour: #18428f
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 0
content_collapseList: 1
lang: en-gb
update_2.8.29: done
latest_version: 2.8.15
on_sale_version: 2.8.32
update_2.8.30: done
headerScheme: dark
perch_mailchimp_api_key: 7222980e29d1b5137a9c7d9d5d0504f4-us1
perch_mailchimp_campaign_url: /mailchimp/campaign/{campaignSlug}
dashboard: 0
hide_pwd_reset: 0
content_hideNonEditableRegions: 0
content_frontend_edit: 0
perch_mailchimp_secret: abba71d
perch_blog_update: 5.0.1
perch_blog_post_url: /blog/{postSlug}
perch_blog_site_name:
perch_blog_slug_format: {postTitle}
perch_blog_akismet_key:
perch_blog_max_spam_days: 0
perch_blog_comment_notify: 0
ltf_customers_setting: 0
logoPath: /perch/resources/learntofly-01.png
ltf_contacts_setting: 0
update_2.8.32: done
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: root
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: ltf_perch
PERCH_DB_PREFIX: perch2_
PERCH_TZ: Australia/Melbourne
PERCH_EMAIL_FROM: nathan@moworks.com.au
PERCH_EMAIL_FROM_NAME: Kai Li
PERCH_LOGINPATH: /perch
PERCH_PATH: /Users/nathan/Documents/LOCAL/clients/learn-to-fly/www/perch
PERCH_CORE: /Users/nathan/Documents/LOCAL/clients/learn-to-fly/www/perch/core
PERCH_RESFILEPATH: /Users/nathan/Documents/LOCAL/clients/learn-to-fly/www/perch/resources
PERCH_RESPATH: /perch/resources
PERCH_HTML5: 1
PERCH_RUNWAY:
PERCH_ERROR_MODE: DIE
PERCH_DATE_LONG: %d %B %Y
PERCH_DATE_SHORT: %d %b %Y
PERCH_TIME_SHORT: %H:%M
PERCH_TIME_LONG: %H:%M:%S
PERCH_RUNWAY_ROUTED:
PERCH_STRONG_PASSWORDS:
PERCH_DEBUG:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /Users/nathan/Documents/LOCAL/clients/learn-to-fly/www/perch/templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_RWD:
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_STRIPSLASHES:
PERCH_PROGRESSIVE_FLUSH: 1
PERCH_PARANOID:
PERCH_FORCE_SECURE_COOKIES:
PERCH_PASSWORD_MIN_LENGTH: 6
PERCH_MAX_FAILED_LOGINS: 10
PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR
PERCH_VERIFY_UPLOADS:
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
PERCH_SESSION_TIMEOUT_MINS: 20
HOSTING SETTINGS

PHP: 5.6.10
Zend: 2.6.0
OS: Darwin
SAPI: apache2handler
Safe mode: not detected
MySQL client: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $
MySQL server: 5.5.42
Free disk space: 819.07 GB
Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, SPL, iconv, intl, json, ldap, mbstring, session, standard, mysqlnd, mysqli, PDO, pdo_mysql, pdo_sqlite, Phar, posix, Reflection, mysql, SimpleXML, soap, sockets, exif, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, zip, apache2handler, imap, yaz, mcrypt, gettext, pgsql, pdo_pgsql
GD: Yes
ImageMagick: No
PHP max upload size: 50M
PHP max form post size: 50M
PHP memory limit: 128M
Total max uploadable file size: 50M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: Yes
HTTP_HOST: localhost:8888
HTTP_CONNECTION: keep-alive
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_REFERER: https://localhost:8888/perch/core/settings/diagnostics/
HTTP_ACCEPT_ENCODING: gzip, deflate, sdch, br
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8
HTTP_COOKIE: _hjIncludedInSample=1; _okdetect=%7B%22token%22%3A%2214773601001030%22%2C%22proto%22%3A%22http%3A%22%2C%22host%22%3A%22localhost%3A4040%22%7D; _okbk=cd4%3Dtrue%2Cvi5%3D0%2Cvi4%3D1477360100305%2Cvi3%3Dactive%2Cvi2%3Dfalse%2Cvi1%3Dfalse%2Ccd8%3Dchat%2Ccd6%3D0%2Ccd5%3Daway%2Ccd3%3Dfalse%2Ccd2%3D0%2Ccd1%3D0%2C; _ok=1700-237-10-3483; olfsk=olfsk05045050452685351; wcsid=XXbU7IIQToesgnV63m39N5PEIE3R0ENa; hblid=HCaJKeN7ByadWFcR3m39N5PEIE3RNE0o; _oklv=1477360183722%2CXXbU7IIQToesgnV63m39N5PEIE3R0ENa; p_m=; SQLiteManager_currentLangue=2; _ga=GA1.1.213663729.1479095572; cmsa=1; PHPSESSID=3c9279f0f05543c732e65d15df60c58e
PATH: /usr/bin:/bin:/usr/sbin:/sbin
SERVER_SOFTWARE: Apache/2.2.29 (Unix) mod_wsgi/3.5 Python/2.7.10 PHP/5.6.10 mod_ssl/2.2.29 OpenSSL/0.9.8zh DAV/2 mod_fastcgi/2.4.6 mod_perl/2.0.9 Perl/v5.22.0
SERVER_NAME: localhost
SERVER_ADDR: ::1
SERVER_PORT: 8888
REMOTE_ADDR: ::1
DOCUMENT_ROOT: /Users/nathan/Documents/LOCAL/clients/learn-to-fly/www
SERVER_ADMIN: you@example.com
SCRIPT_FILENAME: /Users/nathan/Documents/LOCAL/clients/learn-to-fly/www/perch/core/settings/diagnostics/index.php
REMOTE_PORT: 63068
GATEWAY_INTERFACE: CGI/1.1
SERVER_PROTOCOL: HTTP/1.1
REQUEST_METHOD: GET
QUERY_STRING: extended
REQUEST_URI: /perch/core/settings/diagnostics/?extended
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
PHP_SELF: /perch/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1479103517.23
REQUEST_TIME: 1479103517
argc: 1

Thank you again

Drew McLellan

Drew McLellan 2638 points
Perch Support

The values in the accept attribute relate to the section heading in perch/config/filetypes.ini. It looks like you're specifying file extensions instead.

Try:

accept="webimage"

Drew McLellan said:

The values in the accept attribute relate to the section heading in perch/config/filetypes.ini. It looks like you're specifying file extensions instead.

Try:

accept="webimage"

Success! Thank you.

Whilst this thread is still going, is there anyway to use Dropzone.js to replace the file upload button?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, I think that should probably work. It'll require some configuration, though. The Forms app is expecting the fields and the files to be sent in one request, so you'll need to queue the file upload in your dropzone configuration (autoProcessQueue: false I think). Add an event handler to the form to catch the submission, and at that point have dropzone process the queue and send your form fields at the same time (processQueue())

So the file uploads were working last night, and today I added styling classes to the form and uploads no longer work.

<perch:form method="post" app="perch_forms" id="loveinthesky-form">
    <div class="row margin-bottom align-center">

        <perch:label for="file">Upload an Image of your favourite Christmas memory with your partner</perch:label>
        <perch:input name="file" type="file" id="fileupload" accept="webimage" label="File" />
    </div>

    <div class="row margin-bottom">
        <perch:label for="entry-text" class="form-label form-label-wide">Tell us about your favourite Christmas memory with your parner</perch:label>
        <perch:input name="entry-text" type="textarea"  id="entry-text" label="Entry Text" class="textarea-field" />
    </div>
    <div class="row margin-bottom">
        <div class="one-half column">
            <perch:label for="your-name" class="form-label">Your Name</perch:label>
            <perch:input name="your-name" type="text" id="your-name" label="Entrant Name" class="text-field" />
        </div>
        <div class="one-half column">
            <perch:label for="partners-name" class="form-label">Partners Name</perch:label>
            <perch:input name="partners-name" type="text" id="partners-name" label="Partners Name" class="text-field" />
        </div>
    </div>
    <div class="row margin-bottom">
        <div class="one-half column">
            <perch:label for="your-email" class="form-label">Your Email</perch:label>
            <perch:input name="your-email" type="email" id="your-email" label="Entrant Email" class="text-field" />
        </div>
        <div class="one-half column">
            <perch:label for="partner-email" class="form-label">Label</perch:label>
            <perch:input name="partner-email" type="email" id="partner-email" label="Partner Email" class="text-field" />
        </div>
    </div>
    <div class="row align-center">
        <perch:input type="submit" value="Submit" id="submit-button" class="submit-button" />
    </div>

</perch:form>
Perch: 2.8.32
Production mode: Production (100)
Installed apps: content (2.8.32), assets (2.8.32), categories (2.8.32), perch_blog (5.0), perch_forms (1.8.3), ltf_vouchers (1), perch_shop_orders (1.0.9), perch_shop_products (1.0.9), perch_shop (1.0.9), perch_members (1.5)
DB driver: PDO
DB tables: perch2_blog_authors (3), perch2_blog_comments (0), perch2_blog_index (480), perch2_blog_posts (11), perch2_blog_posts_to_tags (33), perch2_blog_sections (1), perch2_blog_tags (12), perch2_blogs (1), perch2_categories (8), perch2_category_counts (4), perch2_category_sets (2), perch2_content_index (7274), perch2_content_items (1014), perch2_content_regions (109), perch2_forms (4), perch2_forms_responses (66), perch2_mailchimp_campaigns (0), perch2_mailchimp_imports (0), perch2_mailchimp_lists (1), perch2_mailchimp_subscribers (0), perch2_mailchimp_subscriptions (0), perch2_mailchimp_webhooks (1), perch2_navigation (0), perch2_navigation_pages (0), perch2_page_templates (6), perch2_pages (34), perch2_resource_log (1356), perch2_resource_tags (0), perch2_resources (388), perch2_resources_to_tags (0), perch2_settings (39), perch2_shop_addresses (0), perch2_shop_admin_index (30), perch2_shop_brands (1), perch2_shop_cart (3), perch2_shop_cart_data (0), perch2_shop_cart_items (0), perch2_shop_countries (250), perch2_shop_currencies (152), perch2_shop_customers (0), perch2_shop_emails (1), perch2_shop_index (11), perch2_shop_option_values (0), perch2_shop_options (0), perch2_shop_order_items (0), perch2_shop_order_promotions (0), perch2_shop_order_statuses (9), perch2_shop_orders (0), perch2_shop_orders_meta (1), perch2_shop_product_files (0), perch2_shop_product_option_values (0), perch2_shop_product_options (0), perch2_shop_product_tags (0), perch2_shop_products (0), perch2_shop_promotions (0), perch2_shop_search (0), perch2_shop_shipping_zone_countries (0), perch2_shop_shipping_zones (1), perch2_shop_shippings (1), perch2_shop_tax_exhibits (0), perch2_shop_tax_group_rates (1), perch2_shop_tax_groups (1), perch2_shop_tax_locations (1), perch2_shop_tax_rates (1), perch2_shop_variants (0), perch2_user_passwords (0), perch2_user_privileges (79), perch2_user_role_privileges (16), perch2_user_roles (2), perch2_users (2)
Users: 2
App runtimes:
<?php
    $apps_list = array(
        'content',
        'categories',
        'perch_forms',
        'perch_blog',
        'perch_members',
        'perch_shop'
    );
Scheduled tasks for perch_blog: delete_spam_comments (1440 mins)
Editor plug-ins: markitup
H1: 421aa90e079fa326b6494f812ad13e79
L1: 3f086b2d471da10d6d4b21741ceefd25
F1: 2edba60ed1f613d6dd804feb202456a2
headerColour: #18428f
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 0
content_collapseList: 1
lang: en-gb
update_2.8.29: done
latest_version: 2.8.15
on_sale_version: 2.8.32
update_2.8.30: done
headerScheme: dark
perch_mailchimp_api_key: 7222980e29d1b5137a9c7d9d5d0504f4-us1
perch_mailchimp_campaign_url: /mailchimp/campaign/{campaignSlug}
dashboard: 0
hide_pwd_reset: 0
content_hideNonEditableRegions: 0
content_frontend_edit: 0
perch_mailchimp_secret: abba71d
perch_blog_update: 5.0.1
perch_blog_post_url: /blog/{postSlug}
perch_blog_site_name:
perch_blog_slug_format: {postTitle}
perch_blog_akismet_key:
perch_blog_max_spam_days: 0
perch_blog_comment_notify: 0
ltf_customers_setting: 0
logoPath: /perch/resources/learntofly-01.png
ltf_contacts_setting: 0
update_2.8.32: done
perch_shop_update: 1.0.9
perch_members_login_page: /members/login.php?r={returnURL}
perch_shop_price_tax_mode: inc
perch_shop_site_url: https://
perch_shop_product_url: /shop/products/{slug}
perch_shop_default_currency: 47
perch_shop_reporting_currency: 47
perch_shop_invoice_number_format: Invoice%d
ltf_vouchers_setting: 0
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: root
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: ltf_perch
PERCH_DB_PREFIX: perch2_
PERCH_TZ: Australia/Melbourne
PERCH_EMAIL_FROM: nathan@moworks.com.au
PERCH_EMAIL_FROM_NAME: Kai Li
PERCH_LOGINPATH: /perch
PERCH_PATH: /Users/nathan/Documents/LOCAL/clients/learn-to-fly/www/perch
PERCH_CORE: /Users/nathan/Documents/LOCAL/clients/learn-to-fly/www/perch/core
PERCH_RESFILEPATH: /Users/nathan/Documents/LOCAL/clients/learn-to-fly/www/perch/resources
PERCH_RESPATH: /perch/resources
PERCH_HTML5: 1
PERCH_RUNWAY:
PERCH_ERROR_MODE: DIE
PERCH_DATE_LONG: %d %B %Y
PERCH_DATE_SHORT: %d %b %Y
PERCH_TIME_SHORT: %H:%M
PERCH_TIME_LONG: %H:%M:%S
PERCH_RUNWAY_ROUTED:
PERCH_STRONG_PASSWORDS:
PERCH_DEBUG:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /Users/nathan/Documents/LOCAL/clients/learn-to-fly/www/perch/templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_RWD:
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_STRIPSLASHES:
PERCH_PROGRESSIVE_FLUSH: 1
PERCH_PARANOID:
PERCH_FORCE_SECURE_COOKIES:
PERCH_PASSWORD_MIN_LENGTH: 6
PERCH_MAX_FAILED_LOGINS: 10
PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR
PERCH_VERIFY_UPLOADS:
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
PERCH_SESSION_TIMEOUT_MINS: 20
PERCH_SHOP_VERSION: 1.0.9
PERCH_APPS_EDITOR_PLUGIN: markitup
PERCH_APPS_EDITOR_MARKUP_LANGUAGE: textile
HOSTING SETTINGS

PHP: 5.6.10
Zend: 2.6.0
OS: Darwin
SAPI: apache2handler
Safe mode: not detected
MySQL client: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $
MySQL server: 5.5.42
Free disk space: 828.85 GB
Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, SPL, iconv, intl, json, ldap, mbstring, session, standard, mysqlnd, mysqli, PDO, pdo_mysql, pdo_sqlite, Phar, posix, Reflection, mysql, SimpleXML, soap, sockets, exif, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, zip, apache2handler, imap, yaz, mcrypt, gettext, pgsql, pdo_pgsql
GD: Yes
ImageMagick: No
PHP max upload size: 50M
PHP max form post size: 50M
PHP memory limit: 128M
Total max uploadable file size: 50M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: Yes
HTTP_HOST: localhost:8888
HTTP_CONNECTION: keep-alive
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_REFERER: https://localhost:8888/perch/core/settings/diagnostics/
HTTP_ACCEPT_ENCODING: gzip, deflate, sdch, br
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8
HTTP_COOKIE: _hjIncludedInSample=1; _okdetect=%7B%22token%22%3A%2214773601001030%22%2C%22proto%22%3A%22http%3A%22%2C%22host%22%3A%22localhost%3A4040%22%7D; _okbk=cd4%3Dtrue%2Cvi5%3D0%2Cvi4%3D1477360100305%2Cvi3%3Dactive%2Cvi2%3Dfalse%2Cvi1%3Dfalse%2Ccd8%3Dchat%2Ccd6%3D0%2Ccd5%3Daway%2Ccd3%3Dfalse%2Ccd2%3D0%2Ccd1%3D0%2C; _ok=1700-237-10-3483; olfsk=olfsk05045050452685351; wcsid=XXbU7IIQToesgnV63m39N5PEIE3R0ENa; hblid=HCaJKeN7ByadWFcR3m39N5PEIE3RNE0o; _oklv=1477360183722%2CXXbU7IIQToesgnV63m39N5PEIE3R0ENa; p_m=; SQLiteManager_currentLangue=2; cmsa=1; _gat=1; _ga=GA1.1.1405297261.1479252124; PHPSESSID=a28f6bb9e32f39249059941947e96760
PATH: /usr/bin:/bin:/usr/sbin:/sbin
SERVER_SOFTWARE: Apache/2.2.29 (Unix) mod_wsgi/3.5 Python/2.7.10 PHP/5.6.10 mod_ssl/2.2.29 OpenSSL/0.9.8zh DAV/2 mod_fastcgi/2.4.6 mod_perl/2.0.9 Perl/v5.22.0
SERVER_NAME: localhost
SERVER_ADDR: ::1
SERVER_PORT: 8888
REMOTE_ADDR: ::1
DOCUMENT_ROOT: /Users/nathan/Documents/LOCAL/clients/learn-to-fly/www
SERVER_ADMIN: you@example.com
SCRIPT_FILENAME: /Users/nathan/Documents/LOCAL/clients/learn-to-fly/www/perch/core/settings/diagnostics/index.php
REMOTE_PORT: 54367
GATEWAY_INTERFACE: CGI/1.1
SERVER_PROTOCOL: HTTP/1.1
REQUEST_METHOD: GET
QUERY_STRING: extended
REQUEST_URI: /perch/core/settings/diagnostics/?extended
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
PHP_SELF: /perch/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1479276801.61
REQUEST_TIME: 1479276801
argc: 1

Everything is pretty much the same as yesterday, apart from the classes.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok. That doesn't really sound like something I can help with then.

It turns out it is the AJAX call. I chose not too use Dropzone, but I'm guessing the file needs to get added to a Queue and then submitted with the form. SerializeArray would not work for this would it?

$('#form1_form').on('submit', function(e) {
    e.preventDefault();
    $('#form1_submit-button').attr('disabled',true);
    $('#form1_submit-button').css('width','auto');
    $('#form1_submit-button').val('Submitting Application');

    var form = $(this)[0];
    var formData = new FormData(form);
    $.ajax({
        url: $(this).attr('action'),
        type: 'post',
        data: formData,
        async: false,
        cache: false,
        contentType: false,
        processData: false,
        success: function(data,res) {
            console.log(data);
            console.log(res);
            $('#form1_submit-button').css('width','auto');
            $('#form1_submit-button').val('Thank you for applying!');
        }
    });
    return false;
});

This is what my AJAX call looks like currently. Is there a setting I need to update on the actual form input to enable a queue?

Drew McLellan

Drew McLellan 2638 points
Perch Support

As long as the file is submitted with the form fields you should be fine. I can't really offer JavaScript help.