Contact form 7 is not working with Safari due file-upload button
-
Hi there,
As you already know; the contact form, build with the CF7 plugin, can not be submitted when using Safari and when the contact form contains a file upload button. The problem only occurs when the user is leaving the upload field blank, so without selecting a file.
For me, the best solution for this problem is to remove the file upload button when there is no file selected. I’ve partly succeeded in doing this through the following Jquery script:jQuery(document).on('submit', '.wpcf7-form', function (e) { jQuery('input.wpcf7-file').each(function() { if (jQuery(this).val() == '') jQuery(this).remove(); }); });
There is only one problem left… When the form is submitted with the upload field left blank, the button is being removed but the spinning arrow icon keeps spinning and nothing happens. ONLY, when the user is submitting the form for a second time, the submission will succeed.
So I want to expand the code shown above with a few lines which is automatically submitting the contact form a second time in case the file upload field is left blank. Because of this the user would not have to submit the contact form twice which can be VERY confusing…Can someone help me out with this? I think this is also a good solution for many other users because I have read many topics from people having the same problem.
Thanks in advance & have a nice day!
Best regards
- The topic ‘Contact form 7 is not working with Safari due file-upload button’ is closed to new replies.