• Resolved RashaMatt

    (@rashamatt)


    My form has many dynamically-generated, identically-named checkboxes with different values, e.g.:

    <label>
        <input type="checkbox" name="InterestedIn" value="Actuator Test Stand">Actuator Test Stand
    </label>
    
    <label>
        <input type="checkbox" name="InterestedIn" value="Air Cycle Machine Test Stand">Air Cycle Machine Test Stand
    </label>
    
    <label>
        <input type="checkbox" name="InterestedIn" value="Air Flow Test Cart">Air Flow Test Cart
    </label>
    

    Note that they all have the same name “InterestedIn”, but different values.

    When this form is submitted, all the user-selected checkboxes are included in the post. But CF7 only includes the LAST one in the generated email (see image).

    How can I have ALL of these identically-named fields from the post included in the generated CF7 email?

    • This topic was modified 2 years, 2 months ago by RashaMatt.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    Thread Starter RashaMatt

    (@rashamatt)

    I have figured out that what is required for this to work is that the name properties of the input tags must end in “[]“, like:

    <label><input type="checkbox" name="InterestedIn[]" value="Engineering & Design"> Engineering & Design</label>
    <label><input type="checkbox" name="InterestedIn[]" value="Fabrication & Machining"> Fabrication & Machining</label>
    <label><input type="checkbox" name="InterestedIn[]" value="Hydrostatic Test Bench"> Hydrostatic Test Bench</label>
    • This reply was modified 2 years, 2 months ago by RashaMatt.
    • This reply was modified 2 years, 2 months ago by RashaMatt.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to report multiple form fields with same name?’ is closed to new replies.