Title: [Plugin: Contact Form 7] Textbox Array
Last modified: August 19, 2016

---

# [Plugin: Contact Form 7] Textbox Array

 *  [Justin Korn](https://wordpress.org/support/users/themonko/)
 * (@themonko)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-contact-form-7-textbox-array/)
 * I realize I am trying to something a bit unique, but was hoping there might be
   an answer.
 * I am creating a form where users will be able to add more text fields as they
   need them available. So, they are filling out a list of cities they want to visit,
   I start them off with 3, but if they want to add more, I provide a button with
   a little javascript and add a new field. Normally, to do this, I’d create each
   text field with an array attribute ie. name=city[] and on submit, loop through
   the array. Unfortunately, I can’t natively do this within Contact Form 7. Perhaps
   there is a way to create a custom type, but without development documentation
   on the plugin, I wasn’t sure exactly what I was doing.
 * Any advice?
 * Thanks!
 * [http://wordpress.org/extend/plugins/contact-form-7/](http://wordpress.org/extend/plugins/contact-form-7/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [Justin Korn](https://wordpress.org/support/users/themonko/)
 * (@themonko)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-contact-form-7-textbox-array/#post-1755584)
 * I figured out how to create a custom field TextArray, however, the email comes
   through with the value ‘Array’ instead of the actual values in the array.
 * If anyone can point me to were this is handled in the plugin so I can possibly
   extract the values properly, I’d really appreciate it.
 * If I find it, I’ll post it, but still struggling at the moment.
 * Thanks!
 *  Plugin Author [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * (@takayukister)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-contact-form-7-textbox-array/#post-1755742)
 * The array of textarea values is cast to a string, so you see the ‘Array’ string
   value. The casting to string is processed in wpcf7_textarea_validation_filter()
   in modules/textarea.php. You can comment out the lines or remove the filters 
   if you don’t want it.
 *  [mrmcq](https://wordpress.org/support/users/mrmcq/)
 * (@mrmcq)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-contact-form-7-textbox-array/#post-1755881)
 * Takayuki…you are fantastic! I’ve been searching for a resolution to this issue
   for months! Thanks for covering this issue, I’ve been utilizing a jQuery field
   duplicator but couldn’t for the life of me figure out how to pass text field 
   values (“Array” issue).
 * Thanks so much, now I just have to figure out how to loop them to come out in
   proper order with the other passing fields. I appreciate your tip!
 *  [maurice-wingfield](https://wordpress.org/support/users/maurice-wingfield/)
 * (@maurice-wingfield)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-contact-form-7-textbox-array/#post-1755918)
 * mrmcq, I couldn’t get the jQuery plugin you’re describing to work and in the 
   end just wrote my own. It took a couple days, but the user can now create and
   delete new fieldsets on the fly. I haven’t gotten as far as getting the “Array”
   issue you describe. I would really appreciate it if you could give me some guidance
   on how the form fields can be coded in such a way for CF7 to recognize it once
   the form’s been submitted.
 * For example, the CF7 form would look like this:
 * 1. CF7 shortcodes
    [text first_name] [submit]
 * 2. CF7 generates the html form
    <form action=”#” method=”post” class=”#”> <input
   type=”text” name=”first_name”> <input type=”submit”> </form>
 * 3. Then the search_and_replace plugin would change the name of the text field
   
   <form action=”#” method=”post” class=”#”> <input type=”text” name=”first_name[]”
   > <input type=”submit”> </form>
 * 4. The user dynamically adds another text field and submits the form
    <form action
   =”#” method=”post” class=”#”> <input type=”text” name=”first_name[]”> <input 
   type=”text” name=”first_name[]”> <input type=”submit”> </form>
 * 5. CF7 has no shortcode for a field named first_name[] and can’t process it.
 * I would love any kind of insight you could provide.
 * Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘[Plugin: Contact Form 7] Textbox Array’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

## Tags

 * [array](https://wordpress.org/support/topic-tag/array/)
 * [text box](https://wordpress.org/support/topic-tag/text-box/)

 * 4 replies
 * 4 participants
 * Last reply from: [maurice-wingfield](https://wordpress.org/support/users/maurice-wingfield/)
 * Last activity: [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-contact-form-7-textbox-array/#post-1755918)
 * Status: not resolved