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!
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.
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!
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.