PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Passing a Unix Timestamp to a form

  1. Hi there. I'm trying to pass a UNIX timestamp to a form. From what I was reading, I can supposedly alter the value of a hidden field with the Gform field value $parameter name function. Here's what I wrote:

    In my theme functions.php:
    add_filter("gform_field_value_timestamp", "unixtime");
    function unixtime($value){
    return time();
    }

    In the form, the field named "timestamp" is hidden, the default value is blank, allow field to be populated dynamically is checked, and the value of the dynamic population is gform_field_value_timestamp.

    Problem is, it's not populating at all.

    What am I doing wrong?

    Posted 12 years ago on Friday March 9, 2012 | Permalink
  2. Instead of setting the value of the dynamic population in the form builder to: gform_field_value_timestamp

    Try setting it just to: timestamp

    and keep your function as-is.

    Posted 12 years ago on Friday March 9, 2012 | Permalink
  3. Working!

    Posted 12 years ago on Friday March 9, 2012 | Permalink
  4. Right on!

    Posted 12 years ago on Friday March 9, 2012 | Permalink

This topic has been resolved and has been closed to new replies.