Forum

Thread tagged as: Question, Problem, Forms

Forms App Not Submitting Forms

Hi, I've read all the docs, triple checked my code, and added the app to the apps.php but I still cannot get a form to submit and show up on the dashboard. Any help? Thanks!

<perch:if exists="form-heading">
    <h1><perch:content order="1" divider-before="Form Options" label="Form Title" id="form-heading" type="text"/></h1>
</perch:if>

<perch:if exists="form-description">
    <h1><perch:content order="2" label="Form Description" id="form-description" type="textarea"/></h1>
</perch:if>




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


    <div class="input">
            <perch:label for="name">Name</perch:label><br>
            <perch:input for="name" type="text" required="true" label="Name"/>
            <perch:error for="name" type="required">Please add your name</perch:error>
        </div>

        <perch:input type="submit" id="submit" value="Submit" />


        <perch:success>
            <div class="alert success">
                <perch:content order="3" id="success" type="textarea" label="Confirmation Message" help="This appears when user successfully submits your form"/>
            </div>
        </perch:success>


</perch:form>
Greg Stone

Greg Stone 0 points

  • 6 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Please can we see your Diagnostics Report?

What happens when you submit the form? Do you see your success message?

No, I'm not getting a success message which clued me that there was a problem somewhere in what I'm doing. Here's my diagnostics report:

PERCH INFORMATION

Perch: 2.8.8
Production mode: Production (100)
Installed apps: content (2.8.8), assets (2.8.8), categories (2.8.8), perch_events (1.9.2), perch_forms (1.8.3)
DB driver: PDO
DB tables: perch2_categories, perch2_category_counts, perch2_category_sets, perch2_content_index, perch2_content_items, perch2_content_regions, perch2_events, perch2_events_categories, perch2_events_to_categories, perch2_forms, perch2_forms_responses, perch2_navigation, perch2_navigation_pages, perch2_page_templates, perch2_pages, perch2_resource_tags, perch2_resources, perch2_resources_to_tags, perch2_settings, perch2_user_privileges, perch2_user_role_privileges, perch2_user_roles, perch2_users
Users: 2
App runtimes:
<?php
    $apps_list = array(
        'content', 
        'categories',
        'perch_forms',
        'perch_events',
    );
Scheduled tasks for perch_events: update_category_counts (60 mins)
Editor plug-ins: markitup, redactor
H1: bcb72d61ca3439ead58df4c9470e02b5
L1: 7427f22896e26c68b23f8d84d388dcb5
headerColour: #54A2ED
content_singlePageEdit: 0
helpURL:
siteURL: /
hideBranding: 1
content_collapseList: 0
lang: en-gb
update_2.8.8: done
latest_version: 2.8.8
on_sale_version: 2.8.8
headerScheme: dark
dashboard: 1
content_frontend_edit: 1
hide_pwd_reset: 0
content_hideNonEditableRegions: 0
logoPath: /perch/resources/New Logo.png
perch_events_update: 1.8
perch_events_detail_url: /events/event.php?s={eventSlug}
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: gregston_champki
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: gregston_paperboy-demo1
PERCH_DB_PREFIX: perch2_
PERCH_TZ: UTC
PERCH_EMAIL_FROM: greg@champkiddesign.com
PERCH_EMAIL_FROM_NAME: Greg Stone
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/gregston/public_html/demo1/perch
PERCH_CORE: /home/gregston/public_html/demo1/perch/core
PERCH_RESFILEPATH: /home/gregston/public_html/demo1/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_DEBUG:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /home/gregston/public_html/demo1/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_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
HOSTING SETTINGS

PHP: 5.4.42
Zend: 2.4.0
OS: Linux
SAPI: cgi-fcgi
Safe mode: not detected
MySQL client: mysqlnd 5.0.10 - 20111026 - $Id: c85105d7c6f7d70d609bb4c000257868a40840ab $
MySQL server: 5.6.23
Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, gettext, SPL, iconv, session, json, mbstring, mcrypt, standard, mysqlnd, mysqli, mysql, Phar, posix, pspell, Reflection, imap, SimpleXML, soap, sockets, exif, tidy, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, cgi-fcgi, PDO, pdo_sqlite, timezonedb, pdo_mysql, ionCube Loader, Zend Guard Loader
GD: Yes
ImageMagick: No
PHP max upload size: 64M
PHP max form post size: 64M
PHP memory limit: 128M
Total max uploadable file size: 64M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: No
CONTEXT_DOCUMENT_ROOT: /home/gregston/public_html/demo1
DOCUMENT_ROOT: /home/gregston/public_html/demo1
GATEWAY_INTERFACE: CGI/1.1
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_ACCEPT_ENCODING: gzip, deflate
HTTP_ACCEPT_LANGUAGE: en-us
HTTP_CONNECTION: keep-alive
HTTP_COOKIE: __utma=111273617.963901815.1435258333.1436296033.1436744005.23; __utmz=111273617.1435258333.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); cmsa=1; PHPSESSID=35d219d37703394be8b908bf067256b6; currency=USD; language=en
HTTP_HOST: demo1.startpaperboy.com
HTTP_REFERER: https://demo1.startpaperboy.com/perch/core/settings/diagnostics/
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12
PATH: /bin:/usr/bin
QUERY_STRING: extended
REDIRECT_STATUS: 200
REMOTE_ADDR: 72.35.141.108
REMOTE_PORT: 48104
REQUEST_METHOD: GET
REQUEST_SCHEME: http
REQUEST_URI: /perch/core/settings/diagnostics/?extended
SCRIPT_FILENAME: /home/gregston/public_html/demo1/perch/core/settings/diagnostics/index.php
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
SERVER_ADDR: 67.212.235.130
SERVER_ADMIN: webmaster@demo1.startpaperboy.com
SERVER_NAME: demo1.startpaperboy.com
SERVER_PORT: 80
SERVER_PROTOCOL: HTTP/1.1
SERVER_SOFTWARE: Apache
UNIQUE_ID: VafZjDJzeO4ADfFI@wMAAAAJ
PHP_SELF: /perch/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1437063565.05
REQUEST_TIME: 1437063565
argc: 1
Drew McLellan

Drew McLellan 2638 points
Perch Support

If you add debug to your page and submit the form, what does it output?

https://docs.grabaperch.com/docs/installing-perch/configuration/debug/

Hi Drew, This is what my form outputs after submission, which didn't change at all from before submission.

Debug Message
SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
Array
(
    [0] => required
)
SELECT * FROM perch2_pages WHERE pagePath='/form-test.php' LIMIT 1
SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/form-test.php' OR regionPage='*' ORDER BY regionPage DESC

This is what it says on my dashboard:


Debug Message SELECT u.*, r.* FROM perch2_users u, perch2_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='c96605b010d680fccc5cb56ce6fffd99' LIMIT 1 UPDATE perch2_users SET userHash='419a3c547335f435603e68484f13cf9c' WHERE userID='1' SELECT p.privKey FROM perch2_user_privileges p SELECT * FROM (SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=1 OR userID=0 ORDER BY userID DESC) AS settings GROUP BY settingID SELECT * FROM perch2_content_regions WHERE regionID=93 LIMIT 1 SELECT * FROM perch2_pages WHERE pageID='86' LIMIT 1 SELECT * FROM perch2_content_items WHERE regionID=93 AND itemRev=3 ORDER BY itemOrder ASC SELECT * FROM perch2_content_items WHERE regionID=93 AND itemRev=3 ORDER BY itemOrder ASC Using template: /templates/content/Form Creator.html INSERT INTO perch2_content_items (itemID, regionID, pageID, itemRev, itemOrder, itemJSON, itemSearch, itemUpdatedBy) SELECT itemID, regionID, pageID, 4 AS itemRev, itemOrder, itemJSON, itemSearch, '1' AS itemUpdatedBy FROM perch2_content_items WHERE regionID=93 AND itemRev=3 ORDER BY itemOrder ASC REPLACE INTO perch2_resource_log (appID, itemFK, itemRowID, resourceID) SELECT cr.appID, cr.itemFK, c2.itemRowID, cr.resourceID FROM perch2_resource_log cr, perch2_content_items c1, perch2_content_items c2 WHERE cr.appID='content' AND cr.itemFK='itemRowID' AND cr.itemRowID=c1.itemRowID AND c1.itemID = c2.itemID AND c1.regionID=93 AND c2.regionID=93 AND c1.itemRev = 3 AND c2.itemRev = 4 Invalid query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'gregston_paperboy-demo1.perch2_resource_log' doesn't exist SELECT itemRowID FROM perch2_content_items WHERE regionID=93 AND itemRev=4 ORDER BY itemOrder ASC UPDATE perch2_content_items SET itemOrder=1000 WHERE itemRowID='1533' UPDATE perch2_content_regions SET regionLatestRev=4 WHERE regionID='93' SELECT regionRev FROM perch2_content_regions WHERE regionID=93 DELETE FROM perch2_content_items WHERE regionID=93 AND itemRev!=3 AND itemRev IN (SELECT itemRev FROM (SELECT DISTINCT itemRev FROM perch2_content_items WHERE regionID=93 ORDER BY itemRev DESC LIMIT 8, 99999) AS t2) DELETE FROM perch2_resource_log WHERE appID='content' AND itemFK='itemRowID' AND itemRowID NOT IN (SELECT itemRowID FROM perch2_content_items) Invalid query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'gregston_paperboy-demo1.perch2_resource_log' doesn't exist SELECT * FROM perch2_content_items WHERE regionID=93 AND itemRev=4 ORDER BY itemOrder ASC DELETE FROM perch2_resource_log WHERE appID='content' AND itemFK='itemRowID' AND itemRowID='1533' Invalid query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'gregston_paperboy-demo1.perch2_resource_log' doesn't exist UPDATE perch2_content_items SET itemJSON='{\"_id\":\"64\",\"fontfamily\":\"Open Sans\",\"form-heading\":\"Test Form\",\"form-description\":{\"raw\":\"\",\"processed\":\"\"},\"success\":{\"raw\":\"Thanks for submitting\",\"processed\":\"Thanks for submitting\"}}', itemSearch=' Open Sans Test Form Thanks for submitting ' WHERE itemRowID='1533' SELECT * FROM perch2_content_items WHERE regionID=93 AND itemRev=4 ORDER BY itemOrder ASC Using template: /templates/content/Form Creator.html UPDATE perch2_content_regions SET regionHTML='<body style=\"font-family: Open Sans\">\n \n<!--====FORM OPTIONS=========================================-->\n\n <h1>Test Form</h1>\n\n\n\n\n\n\n<!--====PERCH FORMS OPENING TAG=========================================-->\n<perch:form template=\"/templates/content/Form Creator.html\" id=\"form-creator\" method=\"post\" app=\"perch_forms\" role=\"form\">\n\n \n\n <div class=\"input\">\n <perch:label for=\"name\">Name</perch:label><br>\n <perch:input for=\"name\" type=\"text\" required=\"true\" label=\"First Name\"/>\n <perch:error for=\"name\" type=\"required\">Please add your name</perch:error>\n </div>\n \n <div class=\"input\">\n <perch:label for=\"email\">Email</perch:label><br>\n <perch:input for=\"email\" type=\"email\" required=\"true\" label=\"Email\" placeholder=\"youremail@example.com\"/>\n <perch:error for=\"email\" type=\"required\">Please add your email address</perch:error>\n <perch:error for=\"email\" type=\"format\">Please check your email address</perch:error>\n </div>\n \n\n \n \n \n \n <!--=======SUBMIT BUTTON====================================================-->\n <perch:input type=\"submit\" id=\"submit\" value=\"Submit\" />\n\n\n \n \n <!--=======SUCCESS MESSAGE====================================================-->\n <perch:success>\n <div class=\"alert success\">\n Thanks for submitting\n </div>\n </perch:success>\n \n \n \n<!--===========END PERCH FORMS TAG=========================================-->\n</perch:form>\n</body>\n\n', regionRev=4, regionLatestRev=4 WHERE regionID='93' Setting alert: Content successfully updated (success) SELECT * FROM perch2_resources WHERE resourceApp='content' AND resourceInLibrary=0 AND resourceCreated<'2015-07-15 18:12:29' AND resourceID NOT IN (SELECT resourceID FROM perch2_resource_log) Invalid query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'gregston_paperboy-demo1.perch2_resource_log' doesn't exist SELECT MIN(itemRev) FROM perch2_content_items WHERE regionID=93 DELETE FROM perch2_content_index WHERE regionID=93 AND itemRev<0 SELECT * FROM perch2_content_items WHERE regionID=93 AND itemRev=4 ORDER BY itemOrder ASC DELETE FROM perch2_content_index WHERE regionID=93 AND itemRev=4 Using template: /templates/content/Form Creator.html INSERT INTO perch2_content_index (itemID, regionID, pageID, itemRev, indexKey, indexValue) VALUES (64,93,86,4,'fontfamily','Open Sans'),(64,93,86,4,'form-heading','Test Form'),(64,93,86,4,'form-description',''),(64,93,86,4,'success','Thanks for submitting'),(64,93,86,4,'_id',64),(64,93,86,4,'_order','1000') OPTIMIZE TABLE perch2_content_index UPDATE perch2_pages SET pageModified='2015-07-16 18:12:29' WHERE pageID='86' SELECT * FROM perch2_content_items WHERE regionID=93 AND itemRev=4 ORDER BY itemOrder ASC Queries: 35 Memory: 3.6237
Drew McLellan

Drew McLellan 2638 points
Perch Support

This:

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

should be:

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

Arrrggghh! Should have seen this. THANKYOU!!!