Contact Form 7
Need help populating custom input fields in email body (1 post)

  1. toolboxwebdesign
    Posted 2 years ago #

    I am using conditional logic drop down based on a number field. So if the person clicks on the number 3...three input fields drop down that will allow each selection to be designated with another variable. It counts the number that is selected and renders the correct number of input fields. The jquery and input fields work fine....but I had to do this in straight code because CF7 doesn't have any conditional logic functionality that I know of within the plugin...so here is my problem.

    I have my CL input fields and they are ID'd (#). Obviously, there is no shortcode to put these inputs within the email body that will come to me when someone submits the form. I want to see if there is a way for me to call these ID's into the email body without having to go in and create shortcodes for them. If not, how do I go about creating the shortcode? Here is my code I used for the functionality:


    Number of inputs:
    <select class="numInputs" onChange="buildInputs(this);">
        <option value="1">1</option>
        <option value="2">2</option>
        <option value="3">3</option>
        <option value="4">4</option>
    <div class="inputs"></div>


    $(document).ready(function () {
        // set onchange event for the select box.
        $('.numInputs').change(function () {
            // clear any inputs added to the div.
            // get number of inputs to add from select box.
            var num = $('.numInputs option:selected').text();
            // build the inputs.
            for (var i = 1; i <= num; i++) {
                $('<input type="text"/><br/>').appendTo('.inputs');

    Here is an example of the functionality. - http://www.toolboxwebdesign.com/form-test

    It would be amazing if I could pull the inputted information into the email body. Thanks for your help!


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

  • RSS feed for this topic
  • Started 2 years ago by toolboxwebdesign
  • This topic is not resolved
  • WordPress version: 3.5.1