• I am using a form to generate a coupon for site visitors. The coupon should “expire” one month after they fill out the form…so I need a way in the email that they get, to list a date that is one month in the future. I assume that placing a hidden field within the form and setting the future date on that field is the way to go, but I am not making much headway. I have a hidden field called hidden-expdate

    I have tried setting up some javascript (not my strong suit) with on_submit in the Additional Settings tab…but no luck thus far. Can someone point me either in the way of making this approach work, or suggest an alternate approach?

    on_submit: “
    var now = new Date();
    expdate = new Date(now.getFullYear(), now.getMonth()+1, now.getDate());
    this.form.elements[“hidden-expdate”].value = expdate;
    return true;

    https://wordpress.org/plugins/contact-form-7/

The topic ‘custom hidden field’ is closed to new replies.