Question
Add Form Submission Date/Time Stamp
I am trying to add Javascript to a Marketo LP using a Marketo form that adds a date/time stamp to the submission. I have created a new field in Marketo named Last Form Submission Date (lastFormSubmissionDate) and am adding the field to the form. Then on the Marketo page I am adding this code to the Custom Head:
<script>
MktoForms2.whenReady(function(mktoForm){
mktoForm.onSubmit(function(mktoForm){
mktoForm.addHiddenFields({
lastFormSubmissionDate : new Date().toISOString()
});
});
});
</script>It is not populating the field though, so wondering what I am doing wrong.