Title: Same hidden field, different values
Last modified: January 9, 2020

---

# Same hidden field, different values

 *  Resolved [contactovisualpt](https://wordpress.org/support/users/contactovisualpt/)
 * (@contactovisualpt)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/same-hidden-field-different-values/)
 * I’m trying to add a hidden field that gets different values depending on options
   on the form, but the uploaded content is stored with always the same value, the
   last one.
 * Something like this:
 * [hidden email-do-servico “”]
 * [group cc-informatica-pc][hidden email-do-servico “email1@domain.com”][/group]
   [
   group cc-informatica-impressoras][hidden email-do-servico “email2@domain.com”][/
   group] [group cc-outros-equipamentos-a-reparar][hidden email-do-servico “email3@domain.
   com”][/group] [group cc-apetrechamento-cantina][hidden email-do-servico “email4@domain.
   com”][/group] [group cc-apetrechamento-informatica][hidden email-do-servico “
   email5@domain.com”][/group]
 * and
 * show [cc-informatica-pc] if [informatica-equipamentos] equals “Computadores”
   
   show [cc-informatica-impressoras] if [informatica-equipamentos] equals “Impressoras”
   show [cc-outros-equipamentos-a-reparar] if [equipamentos-que-necessitam-reparacao]
   not equals “Informática” show [cc-apetrechamento-cantina] if [que-equipamentos-
   necessita] equals “Cantina” show [cc-apetrechamento-informatica] if [que-equipamentos-
   necessita] equals “Informática”
 * I need the field email-do-servico to assume one of the possible options above,
   or be empty if anything else. What happens is that, maybe because is the same
   field name, what is stored in the wp_postmeta values, meta_key _field_email-do-
   servico is always the last one (in this example, [email5@domain.com](https://wordpress.org/support/topic/same-hidden-field-different-values/email5@domain.com?output_format=md)),
   no matter what option is selected by the user.
 * Is it possible to do this?
 * By the way, I also use this strategy to put the email in the CC, and it works
   great, but I also need the right email in the postmeta value.
 * Nelson

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

 *  Plugin Author [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * (@jules-colle)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/same-hidden-field-different-values/#post-12309294)
 * You could add it like this in the To field:
 * `[cc-informatica-impressoras]email1@mail.com[/cc-informatica-impressoras][cc-
   outros-equipamentos-a-reparar]email2@mail.com[/cc-outros-equipamentos-a-reparar]...`
 * Or if you want to use the actual values from the hidden fields, you will need
   to rename the hidden fields to email-do-servico-1, email-do-servico-2, … and 
   then you could use:
 * `[cc-informatica-impressoras][email-do-servico-1][/cc-informatica-impressoras][
   cc-outros-equipamentos-a-reparar][email-do-servico-2][/cc-outros-equipamentos-
   a-reparar] ...`
 *  Thread Starter [contactovisualpt](https://wordpress.org/support/users/contactovisualpt/)
 * (@contactovisualpt)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/same-hidden-field-different-values/#post-12309474)
 * Thank you for the quick answer.
    I do that in the CC, not in the To field, and
   it works great. But that is just part of it. Actually I need the email-do-servico
   field to assume a different value, and that it is stored in the database (I use
   Flamingo to do that). That field is later read in a custom page to identify a
   service email. It’s what I find in the wp_postmeta: meta_key: _field_email-do-
   servico meta_value: (whatver the email is) If I use different names for the field,
   they will be stored like this: meta_key: _field_email-do-servico-1 meta_key: 
   _field_email-do-servico-2 etc Not good.
 *  Plugin Author [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * (@jules-colle)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/same-hidden-field-different-values/#post-12309574)
 * this is one of the shortcomings of my plugin. You can only hide/show fields dynamically,
   but for the moment it is not possible to use the same field name more than once
   or to populate field values dynamically. You’ll need to write some custom javascript
   to update the hidden field value.
 *  Thread Starter [contactovisualpt](https://wordpress.org/support/users/contactovisualpt/)
 * (@contactovisualpt)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/same-hidden-field-different-values/#post-12309603)
 * OK. I was wondering if your PRO version would handle this…
    I’m thinking in a
   postprocess solution in php (not very comfortable with js), but I hope your plugin
   will have this option soon. It’s a great plugin. I pushed it really hard with
   a lot of conditions, and other than this one, it works great. 🙂 Congratulations.
   You deserve 5 stars.
 *  Plugin Author [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * (@jules-colle)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/same-hidden-field-different-values/#post-12311416)
 * Why thank you! No, for the moment the PRO version only supports fields with the
   same name if they are inside a repeater, which is not useful is your case.

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

The topic ‘Same hidden field, different values’ is closed to new replies.

 * ![](https://ps.w.org/cf7-conditional-fields/assets/icon-256x256.png?rev=2072595)
 * [Conditional Fields for Contact Form 7](https://wordpress.org/plugins/cf7-conditional-fields/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cf7-conditional-fields/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cf7-conditional-fields/)
 * [Active Topics](https://wordpress.org/support/plugin/cf7-conditional-fields/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cf7-conditional-fields/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cf7-conditional-fields/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * Last activity: [6 years, 5 months ago](https://wordpress.org/support/topic/same-hidden-field-different-values/#post-12311416)
 * Status: resolved