So if you don't have yet you can create a custom Web Part (or widget) on which code before you have a basic form:
<cms:BasicForm ID="yourNiceForm" runat="server" IsLiveSite="true" />
which you populate with the Alternative form that is selected in the Web Part properties?
Somewhat like:
AlternativeFormInfo afi = AlternativeFormInfoProvider.GetAlternativeFormInfo("YourCustomFormName");
if (afi != null)
{
yourNiceForm.Data = new TheObjectYouWantToFill(); //can be a custom class
yourNiceForm.FormInformation = FormHelper.GetFormInfo("YourCustomFormName", true);
yourNiceForm.AltFormInformation = afi;
yourNiceForm.Visible = true;
yourNiceForm.IsLiveSite = true;
yourNiceForm.OnAfterSave += yourNiceForm_OnAfterSave;
... and so on
}
Than you can add the following method
private void yourNiceForm_OnAfterSave(object sender, EventArgs e)
{
// create TheObjectYouWantToFillInfo object from form data
TheObjectYouWantToFillInfo item = (TheObjectYouWantToFillInfo) yourNiceForm.Data;
if (item != null)
{
//extend object with
item.YourSecretDateField = DateTime.Now;
// your custom logic...
}
}
You can take the 'CustomRegistrationForm' Web Part (or any other using a Alternative Form) as an example:
You can find the code at: ~/CMSWebParts/Membership/Registration/CustomRegistrationForm.ascx.cs
Depending on the exact requirements this should get you started.