Hi,
I have a someone related question that i know im super close on, however not really sure where to go from this point. so my goal is to capture to the millisecond, when the form is being email/or submitted. I am able to capture the time successfully and precisely and display its output in a div, but i dont know how to get that value to be set to a element in the form and send to include in the email(my logic is that this would actually have to delay the form from being sent for a bit, im trying to capture the time they hit submit, which i guess cf7 is actually recording the time the email is successful processed and sent off, see what im saying?)
I use the below code to get the submission to the millisecond and display that in a div with id demo:
<script type=”text/javascript”>
document.addEventListener( ‘wpcf7submit’, function(){
var d = new Date();
var x = document.getElementById(“demo”);
var h = addZero(d.getHours(), 2);
var m = addZero(d.getMinutes(), 2);
var s = addZero(d.getSeconds(), 2);
var ms = addZero(d.getMilliseconds(), 3);
x.innerHTML = h + “:” + m + “:” + s + “:” + ms;
},false);
function addZero(x,n) {
while (x.toString().length < n) {
x = “0” + x;
}
return x;
}
</script>
Any help would be awesome!!! also a concern is the security of this, as the timestamp cant be altered maliciously, so maybe do this server side?? i really dont know.
Thanks,
-Mike