Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    I’m not going to add a form-tag for a hidden field to the plugin, but it would help other users if you publish your code somewhere.

    I used to have my own shortcode for CF7. But when a major update would come my little addition would vanish and I had to reinsert again.

    I even tried to insert my own shortcode within my function file but I thought I was making too much of something little.

    So, since I do not need to use hidden fields in all of my contact forms I insert the following code only when I need it (for the simple stuff) at the very beginning of the form (or at the bottom before the submit button, wherever appropriate)

    <script>
    var thisYr = 2016;
    var nextYr = thisYr + 1;
    document.write('<input type="hidden" name="year" value="' + nextYr + '" />');
    </script>

    and I just call this hidden field at my email form as [year]

    I am using javascript because I am calculating few numbers that I needed. I suppose just entering HTML code will do just fine if you do not need to calculate.

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

The topic ‘Shortcode contribution’ is closed to new replies.