Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How, send Form title (Contact form 7 - WP Plugin) in hidden input?

Its possible send contatc form name in email body?

[contact-form-7 id="86" title="Contact form 1"]

I try the Contact Form 7 Dynamic Text Extension — WordPress Plugins, but my form are in modal items, when i click in one, show me the modal, and change the url (add -> ?id=23) but the Dynamic Text Extension only accept this field in reload page not after.

Any help?

thanks

like image 381
Laranja Mecânica Avatar asked May 23 '16 13:05

Laranja Mecânica


People also ask

How do I pass a hidden field in contact form 7?

Contact Form 7 supports the hidden form-tag type to represent hidden fields. id attribute value of the input element. class attribute value of the input element. To set two or more classes, you can use multiple class: option, like [hidden your-text class:y2008 class:m01 class:d01] .

How do I add a placeholder to a contact form 7 WordPress?

To set placeholder text in a field in your form, you only need to add a placeholder option and a text value to the form-tag representing the field. You can use the placeholder option in the following types of form tags: text, email, url, tel, textarea, number, range, date, and captchar.


1 Answers

I did something similar with the hidden input field and custom shortcode in functions.php. This might helps too

wpcf7_add_shortcode('hidden', 'wpcf7_sourceurl_shortcode_handler', true);

function wpcf7_sourceurl_shortcode_handler($tag) {
    if (!is_array($tag)) return '';

    $name = $tag['name'];
    if (empty($name)) return '';

    $html = '<input type="hidden" name="' . $name . '" value="' . get_the_title() . '" />';
   return $html;
}

Then add custom tag in contact form 7

[hidden pageTitle]

In email settings

Page title is: [pageTitle]
like image 75
Tomas Chudjak Avatar answered Oct 13 '22 12:10

Tomas Chudjak