Title: Adding text depending on clicked button
Last modified: June 30, 2020

---

# Adding text depending on clicked button

 *  Resolved [FY-xMBJbB5](https://wordpress.org/support/users/kiblod/)
 * (@kiblod)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/adding-text-depending-on-clicked-button/)
 * I made a contact form and put into a popup. That popup then should be triggered
   from 2 different buttons on the same site. Depending on the clicked button, I
   want to fill a hidden field with a specific text.
 * So if I click button 1, the hidden field should be “abc”, if I click button 2,
   it should be “def”.
    Where that specific text comes from, is irrelevant. It can
   be the id or name of the buttons or even their label.
 * I was thinking about something like:
 * `[contact-form-7 id="12" title="contact1" myField="abc"]`
 * And put this in the mail template:
 * `[dynamictext dynamicname "CF7_get_custom_field key='myField'"]`
 * But the field remaind empty.

Viewing 1 replies (of 1 total)

 *  Plugin Author [sevenspark](https://wordpress.org/support/users/sevenspark/)
 * (@sevenspark)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/adding-text-depending-on-clicked-button/#post-13243956)
 * What you’re describing requires Javascript, it would not be something that this
   plugin would assist with, sorry.

Viewing 1 replies (of 1 total)

The topic ‘Adding text depending on clicked button’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7-dynamic-text-extension/assets/icon-256x256.
   png?rev=3019574)
 * [Contact Form 7 - Dynamic Text Extension](https://wordpress.org/plugins/contact-form-7-dynamic-text-extension/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7-dynamic-text-extension/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7-dynamic-text-extension/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7-dynamic-text-extension/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7-dynamic-text-extension/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7-dynamic-text-extension/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [sevenspark](https://wordpress.org/support/users/sevenspark/)
 * Last activity: [5 years, 10 months ago](https://wordpress.org/support/topic/adding-text-depending-on-clicked-button/#post-13243956)
 * Status: resolved