WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. rliverman
    Member
    Posted 3 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.

    Link:
    http://174.132.221.20/~coremgmt/jobs/2010/09/business-analyst-website/

    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.

    http://wordpress.org/extend/plugins/contact-form-7/

  2. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 3 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="http://174.132.221.20/~coremgmt/wp-content/themes/core/js/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="http://174.132.221.20/~coremgmt/wp-content/themes/core/js/jquery.main.js"></script>
    <script type="text/javascript" src="http://174.132.221.20/~coremgmt/wp-includes/js/jquery/jquery.form.js"></script>
    <script type="text/javascript" src="http://174.132.221.20/~coremgmt/wp-content/plugins/contact-form-7/scripts.js"></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
    Member
    Posted 3 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
    Member
    Posted 3 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.

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic