Forum

Thread tagged as: Problem, Error, Forms

Form success message not showing

I've just updated to the latest version of Perch (2.8.12) and it seems to be causing an issue with forms. The data in the form is still being submitted but the success message isn't shown. The form submits and the page refreshes and the form is visible with all the data still in the fields. Strangely the URL in the address bar changes from /contact to /contact.php. Form code and debug code below. Any ideas?

<perch:form id="contact" method="post" app="perch_forms">
    <perch:content id="intro" type="textarea" label="Intro" editor="redactor" html="true" />
    <div class="form-row">
        <perch:label for="name">Name</perch:label>
        <perch:input type="text" id="name" required="true" label="Name" />
        <perch:error for="name" type="required"><span class="error">Please add your name</span></perch:error>
    </div>
    <div class="form-row">
        <perch:label for="email">Email</perch:label>
        <perch:input type="email" id="email" required="true" label="Email" placeholder="you@company.com" />
        <perch:error for="email" type="required"><span class="error">Please add your email address</span></perch:error>
        <perch:error for="email" type="format"><span class="error">Please check your email address</span></perch:error>
    </div>
    <div class="form-row">
        <perch:label for="phone">Phone</perch:label>
        <perch:input type="text" id="phone" required="false" label="Phone" required="true" />
        <perch:error for="phone" type="required"><span class="error">Please add your phone number</span></perch:error>
    </div>
    <div class="form-row">
        <perch:label for="message">Message</perch:label>
        <perch:input type="textarea" id="message" required="false" label="Message" />
    </div>
    <div class="form-action">
        <perch:input type="submit" id="submit" value="Submit" class="button" />
    </div>
    <perch:success>
        <div class="success"><perch:content id="success" type="textarea" label="Thank you message" editor="redactor" html="true" /></div>
    </perch:success>
</perch:form>
Debug Message
SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
SELECT * FROM perch2_forms WHERE formKey='contact' LIMIT 1
SELECT * FROM perch2_pages WHERE pagePath='/contact.php' LIMIT 1
INSERT INTO perch2_forms_responses(responseJSON,formID,responseIP,responseSpamData) VALUES('{\"fields\":{\"name\":{\"attributes\":{\"type\":\"text\",\"id\":\"name\",\"required\":\"true\",\"label\":\"Name\"},\"value\":\"Brad\"},\"email\":{\"attributes\":{\"type\":\"email\",\"id\":\"email\",\"required\":\"true\",\"label\":\"Email\",\"placeholder\":\"you@company.com\"},\"value\":\"brad@webrad.co\"},\"phone\":{\"attributes\":{\"type\":\"text\",\"id\":\"phone\",\"required\":\"true\",\"label\":\"Phone\"},\"value\":\"000\"},\"message\":{\"attributes\":{\"type\":\"textarea\",\"id\":\"message\",\"required\":false,\"label\":\"Message\"},\"value\":\"Test\"}},\"files\":[],\"page\":{\"id\":\"5\",\"title\":\"Contact\",\"path\":\"\\/contact.php\",\"navtext\":\"Contact\"}}','2','::1','{\"fields\":[],\"environment\":{\"UNIQUE_ID\":\"VddJ8cCoAAgAAAcFLoQAAAAD\",\"HTTP_HOST\":\"melbournenannieswhocare.dev\",\"HTTP_CONNECTION\":\"keep-alive\",\"CONTENT_LENGTH\":\"175\",\"HTTP_CACHE_CONTROL\":\"max-age=0\",\"HTTP_ACCEPT\":\"text\\/html,application\\/xhtml+xml,application\\/xml;q=0.9,image\\/webp,*\\/*;q=0.8\",\"HTTP_ORIGIN\":\"https:\\/\\/melbournenannieswhocare.dev\",\"HTTP_UPGRADE_INSECURE_REQUESTS\":\"1\",\"HTTP_USER_AGENT\":\"Mozilla\\/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/44.0.2403.157 Safari\\/537.36\",\"CONTENT_TYPE\":\"application\\/x-www-form-urlencoded\",\"HTTP_REFERER\":\"https:\\/\\/melbournenannieswhocare.dev\\/contact\",\"HTTP_ACCEPT_ENCODING\":\"gzip, deflate\",\"HTTP_ACCEPT_LANGUAGE\":\"en-US,en;q=0.8\",\"HTTP_COOKIE\":\"__utma=84286469.1720901697.1440138005.1440142702.1440165660.3; __utmb=84286469.0.10.1440165660; __utmc=84286469; __utmz=84286469.1440138005.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)\",\"PATH\":\"\\/usr\\/bin:\\/bin:\\/usr\\/sbin:\\/sbin\",\"SERVER_SIGNATURE\":\"\",\"SERVER_SOFTWARE\":\"Apache\",\"SERVER_NAME\":\"melbournenannieswhocare.dev\",\"SERVER_ADDR\":\"::1\",\"SERVER_PORT\":\"80\",\"REMOTE_ADDR\":\"::1\",\"DOCUMENT_ROOT\":\"\\/Users\\/bradhardinge\\/Documents\\/clients\\/melbournenannieswhocare\\/site\\/production\",\"SERVER_ADMIN\":\"you@example.com\",\"SCRIPT_FILENAME\":\"\\/Users\\/bradhardinge\\/Documents\\/clients\\/melbournenannieswhocare\\/site\\/production\\/contact.php\",\"REMOTE_PORT\":\"51749\",\"GATEWAY_INTERFACE\":\"CGI\\/1.1\",\"SERVER_PROTOCOL\":\"HTTP\\/1.1\",\"REQUEST_METHOD\":\"POST\",\"QUERY_STRING\":\"\",\"REQUEST_URI\":\"\\/contact.php\",\"SCRIPT_NAME\":\"\\/contact.php\",\"PHP_SELF\":\"\\/contact.php\",\"REQUEST_TIME_FLOAT\":1440172529.95,\"REQUEST_TIME\":1440172529,\"argv\":[],\"argc\":0}}')
SELECT * FROM perch2_forms_responses WHERE responseID='19' LIMIT 1
No ids to log.
SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/contact.php' OR regionPage='*' ORDER BY regionPage DESC
Using template: /templates/pages/attributes/seo.html
SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 ORDER BY pageTreePosition ASC
SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/contact.php' LIMIT 1
SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-006', '000')
Using template: /templates/navigation/level1.html
Brad Hardinge

Brad Hardinge 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Which version were you running previously?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Hmm, I think I've found it. Hang fire for 2.8.13.

Drew McLellan

Drew McLellan 2638 points
Perch Support

That should now be available.