I need to pass UTC into a hidden field in an HTML form. The actual time doesn’t really matter, just using it as an order identifier that will be unique for each order.
Here is what I have but it isn’t working… Appreciate any help.
— in form section —
<input id="pg_consumerorderid" value="" type="hidden">
— Script just below the < /form> tag
<script> var field = document.querySelector('#pg_consumerorderid'); var date = Date.now(); // Set the date field.value = date; </script>
All my other form fields use input name= instead of the input id= Not sure if that is messing things up.