• Hello,

    ive posted b4 with nobody trying to help me

    This is the last thing i need to work on my site…
    thank you in advanced!!
    ive tried using the following code with no avail. i can set an alert to give me the correct time but cannot set an element in the form to get sent to the email with the value….

    The alert for ttlTime i belive gives me the correct time to the millisecond.. where im struggling is getting that value into the email sent on submission… or inserted into a form field.. like a hidden one… cant figure it out…

    thank you!!

    alert(“test”);
    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);
    var ttlTime = h + “:” + m + “:” + s + “:” + ms;
    x.value = ttlTime;
    var toy = document.getElementsByClassName(“demo”);
    toy.value = ttlTime;
    alert(ttlTime);

    function addZero(x,n) {
    while (x.toString().length < n) {
    x = “0” + x;
    }
    return x;
    }

    }

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Need time stamp problem resolved’ is closed to new replies.