Contact Form 7
[resolved] Validation fails with file attachment set as required (4 posts)

  1. rliverman
    Posted 5 years ago #

    I recently upgraded to 2.4.1 and now the form will not validate that required fields are missing once a file has been selected as an attachment. Upon submission (with missing email (which is set as required)) the form doesn't show any alerts that the file is missing and processes the form but obviously can't email it anywhere.


    Select "Submit a Resume"

    Side note, it is frustrating that an attachment cannot be deselected or delete via the text box once it has been selected.


  2. Takayuki Miyoshi
    Plugin Author

    Posted 5 years ago #

    I checked your site and the HTML source, then found the possible cause soon. It's because that your theme has been created incorrectly. Try switching back to the default theme then you'll see it works correctly.

    Your theme's problems are:

    1. It shouldn't load JavaScript files from the template. First, delete these lines from header.php:

    <script type="text/javascript" src=""></script>
    <script type="text/javascript" src=""></script>
    <script type="text/javascript" src=""></script>
    <script type="text/javascript" src=""></script>

    2. Put <?php wp_head(); ?> into header.php and <?php wp_footer(); ?> into footer.php, respectively. Necessary script files will be loaded automatically.

  3. rliverman
    Posted 5 years ago #

    I had to block the plugin from loading its own version of jquery by adding the following in wp-config.php:

    define ('WPCF7_LOAD_JS', false );

    and then calling the forms other jquery files in the header separately.

    The reason I'm blocking the separate installation of jquery is it is once it is loaded my other jquery functions on the site are working. I read that others were having this issue as well but apparently this wp-config solution isn't working for me so I'll keep googling around. Any help is appreciated!

  4. rliverman
    Posted 5 years ago #

    Solved! You were correct and I ended up needing to still load my own Jquery version but do so below the wp-head function and relocate my wp-footer calls.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contact Form 7
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic