• Student Loan Freedom Project

    (@student-loan-freedom-project)


    Hello and Merry Christmas!

    I am working with a form through CF7. I coded a javascript checkbox to be able to “Add New Loan” upon checking it. However, when the fields are hidden, it still requires the user to input information into the form fields that are not showing. I would like it if the fields are hidden, they are not required to input information.

    This is the form I am working with on my Website:http://www.slfpusa.org/testing-page/

    This is the javascript code that I am using:

    <script type=”text/javascript” language=”JavaScript”>
    function HidePart(d) {document.getElementById(d).style.display = “none”;}
    function ShowPart(d) {document.getElementById(d).style.display = “block”;}
    function CheckboxChecked(b,d) {
    if(b) {ShowPart(d);}
    else {HidePart(d);}
    }
    </script>

    <input type=”checkbox” name=”mycheckbox” value=”yes” onclick=”CheckboxChecked(this.checked,’checkboxdiv’)”> Add New Loan

    Any help solving what I am trying to do would be much appreciated!

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

  • The topic ‘Javascript—Make Hidden Fields Not Required’ is closed to new replies.