Viewing 2 replies - 1 through 2 (of 2 total)
  • This is not available directly in Contact Form 7. It can be done via custom programing using jQuery.

    Hello.
    All you need is create fields with name with brackets (<input … name=”data[]” />)
    Unfortunately, CF7 can’t parse construction like ([text data[] id:data]), so you have to add brackets via JS.
    Example:
    [text data class:data] <a href="#" class="add">+</a>

    jQuery(document).ready(function($){
      $('.data').attr('name', $('.data').attr('name') + '[]');
      $('.add').on('click', function(e){
        e.preventDefault();
        $('.data:first').clone().val('').appendTo('form');
      });
    });

    The message will contain your data separated with commas.
    This is a simple solution without any validation.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘More input fields with click’ is closed to new replies.