donaldlundgren1
6 years agoQrew Trainee
Passing Date Field and Rid to my codepage
I am using the below code in a html code page but I need to pass my Date Field and my rid to this codepage. I am displaying the codepage in my form so that there is a countdown till due.
<p id="demo"></p>
<script>
var countDownDate = new Date("8-10-2019").getTime();
var x = setInterval(function() {
var now = new Date().getTime();
var distance = countDownDate - now;
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
document.getElementById("demo").innerHTML = days + "d " + hours + "h "
+ minutes + "m " + seconds + "s ";
if (distance < 0) {
clearInterval(x);
document.getElementById("demo").innerHTML = "EXPIRED";
}
}, 1000);
</script>
The var countDownDate is where I need to get my fid 166 from what ever record I happen to open...
The code I am using to display the page is -
"<img data-url='" & [URL 1] & "'" &
" src onerror='(async () => { var url = this.dataset.url; this.outerHTML = '<iframe src=${url} width=155px height=50px></iframe>';})();'>"
Can anyone help?
<p id="demo"></p>
<script>
var countDownDate = new Date("8-10-2019").getTime();
var x = setInterval(function() {
var now = new Date().getTime();
var distance = countDownDate - now;
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
document.getElementById("demo").innerHTML = days + "d " + hours + "h "
+ minutes + "m " + seconds + "s ";
if (distance < 0) {
clearInterval(x);
document.getElementById("demo").innerHTML = "EXPIRED";
}
}, 1000);
</script>
The var countDownDate is where I need to get my fid 166 from what ever record I happen to open...
The code I am using to display the page is -
"<img data-url='" & [URL 1] & "'" &
" src onerror='(async () => { var url = this.dataset.url; this.outerHTML = '<iframe src=${url} width=155px height=50px></iframe>';})();'>"
Can anyone help?