Forum

Thread tagged as: Question, Problem, Forms

Form debug - need assistance

Hi all,

I'm quite new to Perch and require some help debugging an issue with my form not working properly in Safari. It seems that the form does not post data at all, and the validation does not appear to work. When submit is clicked, the fields remain filled in but do not post to the CMS. Everyuthing is working perfectly in Chrome.

The following is the form code used within the page:

Diagnostic report: Perch is out of date. You are running Perch 2.8.8 and the latest is 2.8.26. Update instructions PHP 5.6.13 is up to date MySQL 5.6.29-log is up to date Image processing available SUMMARY INFORMATION

Perch: 2.8.8, PHP: 5.6.13, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $, with PDO Server OS: Linux, apache2handler Installed apps: content (2.8.8), assets (2.8.8), categories (2.8.8), perch_blog (4.6), perch_events (1.9.2), perch_forms (1.8.3) App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_events', 'perch_blog', 'perch_forms' ); PERCH_LOGINPATH: /admin PERCH_PATH: PERCH_CORE: PERCH_RESFILEPATH: Image manipulation: GD Imagick PHP limits: Max upload 128M, Max POST 128M, Memory: 256M, Total max file upload: 128M Resource folder writeable: Yes HTTP_HOST: DOCUMENT_ROOT REQUEST_URI: SCRIPT_NAME:

I have removed some fields for client privacy.

<div class="container">
    <div class="row">

    <perch:form id="landing-page-contact" method="post" app="perch_forms">

        <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 col-sm-10 col-sm-offset-1  col-xs-12">
            <h4 style="margin-bottom:20px;">Please contact me to discuss:</h4>
        </div>

        <div class="form-process"></div>

        <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 col-sm-10 col-sm-offset-1 col-xs-12">
            <perch:label for="template-contactform-name">Name <small>*</small></perch:label>
            <perch:input type="text" id="name" required="true" label="Name" name="template-contactform-name" class="sm-form-control required" />
            <perch:error for="email" type="required">Please add your name</perch:error>
        </div>

        <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 col-sm-10 col-sm-offset-1  col-xs-12">
            <perch:label for="template-contactform-practice">Practice/Lab name and address<small>*</small></perch:label>
            <perch:input type="text-area" id="template-contactform-practice" name="template-contactform-practice" required="true" label="Practice/Lab" class="sm-form-control" />
        </div>

        <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 col-sm-10 col-sm-offset-1 col-xs-12">
            <perch:label for="template-contactform-email">Email <small>*</small></perch:label>
            <perch:input type="email" id="template-contactform-email" name="template-contactform-email" required="true" label="Email" class="required email sm-form-control" />
            <perch:error for="email" type="required">Please add your email address</perch:error>
            <perch:error for="email" type="format">Please check your email address</perch:error>
        </div>

        <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 col-sm-10 col-sm-offset-1 col-xs-12">
            <perch:label for="template-contactform-phone">Telephone</perch:label>
            <perch:input type="text-area" id="template-contactform-phone" name="template-contactform-phone" label="Telephone" class="sm-form-control" />
        </div>

        <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 col-sm-10 col-sm-offset-1 col-xs-12">
            <perch:label for="template-contactform-message">Message <small>*</small></perch:label>
            <perch:input type="textarea" id="template-contactform-message" required="true" label="Message" class="required sm-form-control" name="template-contactform-message" rows="6" cols="30" />
            <perch:error for="message" type="required">Please add a message</perch:error>
        </div>

        <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 col-sm-10 col-sm-offset-1 col-xs-12">
            <perch:input type="submit" id="submit" value="Send Message" class="button button-3d nomargin landing-page-btn" id="template-contactform-submit" name="template-contactform-submit" />
        </div>

        <div class="col_full hidden">
            <perch:input type="text" id="banana" antispam="honeypot" />
        </div>

        <perch:success>
            <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 col-sm-10 col-sm-offset-1 col-xs-12" id="contact-form-result" data-notify-type="success" data-notify-msg="<i class=icon-ok-sign></i> Message Sent Successfully!"><i class=icon-ok-sign></i> Message Sent Successfully! Someone will be in touch with you soon.</div>
        </perch:success>

    </perch:form>
</div>

</div>

When running debug, this is the message I get when clicking on the relevant contact form within 'forms' in the CMS:

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=2 AND u.userHash='b4eb8c4dd2f619a7db508f3a09ccaa95' LIMIT 1 UPDATE perch2_users SET userHash='2d5918d423f1accfdf9d8b2f40ca2b5f' WHERE userID='2' SELECT p.privKey FROM perch2_user_privileges p SELECT * FROM (SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=2 OR userID=0 ORDER BY userID DESC) AS settings GROUP BY settingID SELECT * FROM perch2_forms WHERE formID='3' LIMIT 1 SELECT SQL_CALC_FOUND_ROWS DISTINCT * FROM perch2_forms_responses WHERE formID=3 AND responseSpam=0 ORDER BY responseCreated DESC LIMIT 0, 10 SELECT FOUND_ROWS() AS count Queries: 8 Memory: 2.0325

Hope you can help.

Many thanks

Gary Ward

Gary Ward 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Check for field validations with no matching error message. It sounds like the submission is being stopped by validation.

Thanks Drew, will take a look.