• Hi all

    I have a contact form which has two file upload buttons. At the moment, the contact form has several mandatory text fields, but the two file upload buttons are not. Which means someone can submit a form without uploading anything, and that defeats the purpose of the form. So could someone please let me know how to make those buttons mandatory? The code for my form is as follows:

    <script>
        UPLOADCARE_PUBLIC_KEY = '56db9a54c6d5c31d0a14';
    UPLOADCARE_CLEARABLE = true;
    </script>
    <script charset="utf-8" src="https://ucarecdn.com/widget/2.3.2/uploadcare/uploadcare.full.min.js"></script>
    
    <style> .uploadcare-widget-button-open { background-color: #91e05c !important; } .uploadcare-widget-button-open:hover { background-color: #abf07d !important; } </style>
    
    <p>First name*<span style="font-family: verdana, geneva; font-size: 12pt; color: #91e05c;"> This is the forename which will be attributed to your work.</span><br />
        [text* first-name] </p>
    
    <p>Last name*<span style="font-family: verdana, geneva; font-size: 12pt; color: #91e05c;"> This is the surname which will be attributed to your work.</span><br />
        [text* last-name] </p>
    
    <p>Your email*<br />
        [email* your-email] </p>
    
    <p>Author Bio*<span style="font-family: verdana, geneva; font-size: 12pt; color: #91e05c;"> Introduce yourself! Tell everyone where they can find more of your work.  Just drag the bottom right corner if you need more space.</span><br />
        [textarea* author-bio] </p>
    
    <p>What is the title of your work?*<span style="font-family: verdana, geneva; font-size: 12pt; color: #91e05c;"> We'll use upper and/or lower case depending on what you use here!</span><br />
        [text* title-of-your-work] </p>
    
    <p>Synopsis*<span style="font-family: verdana, geneva; font-size: 12pt; color: #91e05c;"> This is your chance to entice listeners! Just drag the bottom right corner if you need more space.</span><br />
        [textarea* synopsis] </p>
    
    [checkbox Adult-Content use_label_element "My work contains adult content. "] <span style="color: #91e05c;"><span style="text-decoration: underline;"><a href="http://www.bibliophone.com/adult-content" target="_blank"><span style="color: #91e05c; text-decoration: underline;">What's this about?</span></a>
    
    <p>Upload a cover image. <span style="color: #91e05c;"><span style="text-decoration: underline;"><a href="http://www.bibliophone.com/cover-image-guide" target="_blank"><span style="color: #91e05c; text-decoration: underline;">Please read our cover image guide</span></a></span></span> <br />
    <input type="hidden" role="uploadcare-uploader" name="coverimage" />
    
    <p>Upload your audio file. <span style="color: #91e05c;"><span style="text-decoration: underline;"><a href="http://www.bibliophone.com/audio-book-upload-guide" target="_blank"><span style="color: #91e05c; text-decoration: underline;">Please read our audio book upload guide</span></a></span></span><br />
    <input type="hidden" role="uploadcare-uploader" name="audiofile" />
    
    <p>I accept Bibliophone's Terms of Use*<br />
    [acceptance acceptance-620]
    
    <p>[submit class:submitbutton "Submit"]</p>

    Thanks everyone,

    Paul

    https://wordpress.org/plugins/contact-form-7/

  • The topic ‘Struggling to make a file submit button mandatory’ is closed to new replies.