Sometimes it may be useful to have a hotspot that automatically fills in a date field with the current date. For example, perhaps your form requires the filler to record the date on which they are filling it out. This process can easily be made more automated by using a hotspot that automatically records the date for them.
Creating the Hotspot
Unsurprisingly, the first step to creating a current date hotspot is to create the hotspot itself. For sake of this explanation, we will use a basic form that has a CText field formatted for a MM/DD/YYYY date value and a button next to it that has the hotspot to get the date.
With the hotspot created, you should go ahead and add the AfterInkAdded event handler to your script code. This explanation will focus on VB.NET scripting.
Getting the Date
Dim todaysDate As Date = Date.Today Dim todayString As String = todaysDate.ToString("MM/dd/yyyy")
Using the Date
_Date.Value = todayString
Now, when the user clicks the "Get Date" button/hotspot, the CText field will store the date.