Hi Everyone,
Found a neat and simple solution to the need to capture and pass today’s date into a custom date field, to allow a campaign to test and branch based on the date. Today’s date is captured and submitted via a hidden input field in the order form.
Where StartDate is the custom field created in Infusionsoft.
Referenced via Contact0_StartDate.
All credit to StackOverflow for the solution modified for this use:
<!-- Get Today's Date and submit via a hidden field for Start Date -->
<input name="Contact0_StartDate" id="Contact0_StartDate" type="hidden" value="" />
<script type="text/javascript">
function getDate()
{
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1; //January is 0!
var yyyy = today.getFullYear();
if(dd<10){dd='0'+dd} if(mm<10){mm='0'+mm}
today = yyyy+""+mm+""+dd;
document.getElementById("Contact0_StartDate").value = today;
}
//call getDate() when loading the page
getDate();
</script>
In the order form you insert this code in the Product Area custom HTML section.
Hope this helps someone.
Alastair