• Resolved Thomymaster

    (@thomymaster)


    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)
  • hi @thomymaster,

    can you show me the website or a working example (jsfiddle/codepen/…)?

    Thread Starter Thomymaster

    (@thomymaster)

    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

    (@thomymaster)

    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.