WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
Add fields on the fly (3 posts)

  1. cruiseback
    Member
    Posted 3 years ago #

    Hi all,

    I would like to create a form where users can add a certain field on the fly while filling out the form.
    I am using CF7 for a report style form, where users can submit data into a textfield and send it to me.

    But, if they have more than one data entry they should be able to add additional fields.

    I know how to add the fields with js (basically just cloning the initial field), but how do I get CF7 to display the added fields in the mail report, when CF7 isn't 'aware' of the fields to begin with?

  2. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 3 years ago #

    How about adding normal text fields and 'display: none' style, then adding JS that switches show/hide of the fields?

    I mean,

    In your form:
    [text your-text-a class:hidden]

    In your CSS stylesheet:
    .hidden { display: none; }

    In your mail:
    [your-text-a]

  3. cruiseback
    Member
    Posted 3 years ago #

    Hi Takayuki,

    Thank you for your reply.

    Yea, that's actually a good idea.

    Only problem is of course having enough fields available then, without creating mails that contain 50 empty lines each time..
    Can you make it so in the report email that the field is only parsed if it contains content?

    Thanks, cb

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic