Forum

Thread tagged as: Problem, Forms

Trouble submitting form and file upload in Safari and Firefox

Hi, hope someone can help.

I'm trying to get a form to post successfully using Safari and Firefox (with file upload) - Chrome working successfully but not these others. All that happens is that it sends you to the top of the page and the form remains filled in with no success message.

Perch Debug bring up the following:

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='7778469321d673d7ee0e90fdd5e16b8f' LIMIT 1
UPDATE perch2_users SET userHash='c873275d6cdd9f0746d37fa80a64635c' WHERE userID='1'
[38] SELECT p.privKey FROM perch2_user_privileges p
[24] SELECT * FROM (SELECT DISTINCT settingID, settingValue, userID FROM perch2_settings WHERE userID=1 OR userID=0 ORDER BY userID DESC) AS settings GROUP BY settingID, settingValue, userID
[1] SELECT * FROM perch2_pages WHERE pageID=12 LIMIT 1
[6] SELECT * FROM perch2_content_regions WHERE pageID=12 AND regionPage!='*' ORDER BY regionOrder ASC
[1] SELECT COUNT(*) FROM perch2_content_items WHERE itemJSON!='' AND regionID=104 AND itemRev=2
[1] SELECT COUNT(*) FROM perch2_content_items WHERE itemJSON!='' AND regionID=105 AND itemRev=2
[1] SELECT COUNT(*) FROM perch2_content_items WHERE itemJSON!='' AND regionID=106 AND itemRev=3
[1] SELECT COUNT(*) FROM perch2_content_items WHERE itemJSON!='' AND regionID=107 AND itemRev=3
[1] SELECT COUNT(*) FROM perch2_content_items WHERE itemJSON!='' AND regionID=108 AND itemRev=1
[1] SELECT COUNT(*) FROM perch2_content_items WHERE itemJSON!='' AND regionID=109 AND itemRev=1

I noticed someone else had this problem with it being the date validation. I've changed this to a normal field but still no joy.

If any one can help, I'd be very grateful.

Gary Ward

Gary Ward 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Is that debug from the page itself? It looks like control panel debug to me.

Apols Drew, yes thats the debug taken from the admin area when clicking on the page. How do I get it from the page itself? The site is live and I don't want any messages appearing on the live site? Am still a bit of a Perch newb! Unfortunately the site went live before this was discovered.

Many thanks

Rachel Andrew

Rachel Andrew 394 points
Perch Support

Is the same happening on your development version of the site, or just on the live site? If it is only happening on the live site you should compare them to see what the difference is.

Hi Drew,

Have added:

<?php PerchUtil::output_debug(); ?>

to the footer now on the dev site and this is the output before submitting the form:

SELECT * FROM perch2_pages WHERE pagePath='/apply/index.php' LIMIT 1
[9] SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/apply/index.php' OR regionPage='*' ORDER BY regionPage DESC
[25] SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
Using template: /templates/forms/members_application_form.html
Using template: /templates/forms/footer_contact_form.html

and this is the output after submission:

SELECT * FROM perch2_pages WHERE pagePath='/apply/index.php' LIMIT 1
[25] SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
Array
(
    [DOB] => format
)
[9] SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/apply/index.php' OR regionPage='*' ORDER BY regionPage DESC
Using template: /templates/forms/members_application_form.html
Using template: /templates/forms/footer_contact_form.html

Appears to point to this offending div:

<div class="row">
                        <perch:label for="DOB" class="col-md-4">Date of Birth</perch:label>
                        <div class="col-md-8">
                          <perch:input type="text" id="DOB" label="DOB" class="form-control" />
                         <!--  <perch:error for="DOB" type="required"><span class="error">Please enter your Date of Birth</span></perch:error> -->
                        </div>
                    </div>

Originally the type was date but I changed this to text, believing the type to be the offending issue?

Any help you can offer here will be valuable. I'm going to run a test and remove this div entirely to see what happens - will let you know the results.

Regards

Rachel Andrew said:

Is the same happening on your development version of the site, or just on the live site? If it is only happening on the live site you should compare them to see what the difference is.

Hi Rachel - same is happening it would seem. See post above for explanation and debug. Hope you can help.

Rachel Andrew

Rachel Andrew 394 points
Perch Support

Can we see your entire template and the Diagnostic Report please?

Hi Rachel,

Have had some success with Safari uploading pdf and doc types now.

Is there a way of adding 'docx' as these don't seem to be working. We have used accept="office" which according to Drew on another post, should allow all Word formats?

FIxed! Thanks for all your help!