craftcms / contact-form

Add a simple contact form to your Craft CMS site.
https://plugins.craftcms.com/contact-form
MIT License
294 stars 93 forks source link

Script to show attachment filename stops email sending but goes to redirect #233

Closed jamiematrix closed 8 months ago

jamiematrix commented 2 years ago

Description

I have a little script to show the customer the filename of the attachment they have chosen:

{% js %}
    document.querySelector("#CV").onchange = function(){
        document.querySelector("#CVLabel").textContent = `${this.files[0].name} selected`;
    }
{% endjs %}

When this script is on the page the contact form fails to send if an attachment is present, but redirects to a thank-you page without issue.

Steps to reproduce

  1. Add the above script to the contact form
  2. Send email with attachment

Additional info

i-just commented 1 year ago

Hi, thanks for reaching out. I can’t quite replicate this issue by just adding the JS you posted. I can, however, replicate it if I intentionally trigger an error in the email template I specify via the Contact Form Extensions plugin settings (e.g. try to print out a variable that doesn’t exist). Is there anything in the logs that would suggest what the problem is? Logs to have a look at are: storage/logs/web.log and also your system’s email logs

i-just commented 8 months ago

Closing due to inactivity. If this is still a problem, please provide the requested details, and we’ll pick it up again.