Title: Hidden attribute not working
Last modified: June 22, 2021

---

# Hidden attribute not working

 *  Resolved [Thomymaster](https://wordpress.org/support/users/thomymaster/)
 * (@thomymaster)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/hidden-attribute-not-working/)
 * Hi
 * WordPress: 5.7.2
    Plugin Version: 5.3.2
 * I have a contact form which needs a hidden field (which must be there and filled
   with content because of the use in the emails as [your-name].
 * The content of the field is fetched with jQuery.
 * Inside the contact form, it is implemented like this
 * —
    <label> Name * [text* hidden your-name class:your-name] </label> —
 * The input is correctly fetched from jQuery, however, the hidden property is not
   obeyed (the field is visible).
    What am i doing wrong here?
 * Best,
    Thomas

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

 *  [Erik](https://wordpress.org/support/users/codekraft/)
 * (@codekraft)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/hidden-attribute-not-working/#post-14583365)
 * hi [@thomymaster](https://wordpress.org/support/users/thomymaster/),
 * can you show me the website or a working example (jsfiddle/codepen/…)?
 *  Thread Starter [Thomymaster](https://wordpress.org/support/users/thomymaster/)
 * (@thomymaster)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/hidden-attribute-not-working/#post-14589579)
 * Hi
 * In my content-single-product.php (WooCommerce) i am fetching customer data via
   —
 *     ```
       <!-- 03.11.20 TS: because article names can contain ", we have to use '-->
                       <script>
                       (function($){
                               $(".product_name").val('<?php echo $subject;?> (<?php echo $product->get_sku(); ?>)');
                               $(".your-name").val('<?php echo $current_user->user_firstname. " " .$current_user->user_lastname;?>');
                               $(".your-email").val('<?php echo $current_user->user_email;?>');
                       })(jQuery);
                       </script>
       ```
   
 * —
 * On this page, there is also the contact form and like i said, its not working
 *  Thread Starter [Thomymaster](https://wordpress.org/support/users/thomymaster/)
 * (@thomymaster)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/hidden-attribute-not-working/#post-14589722)
 * I was a bit too stupid, if i use this it works
 * [hidden your-name class:your-name]

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

The topic ‘Hidden attribute not working’ 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/)

 * 3 replies
 * 2 participants
 * Last reply from: [Thomymaster](https://wordpress.org/support/users/thomymaster/)
 * Last activity: [4 years, 10 months ago](https://wordpress.org/support/topic/hidden-attribute-not-working/#post-14589722)
 * Status: resolved