variables.error = arrayNew(1);
if (isdefined("form.eventTitle")) {
function IsEmail(str) {
if (REFindNoCase("^['_a-z0-9-]+(\.['_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.(([a-z]{2,3})|(aero|coop|info|museum|name))$",str)) return TRUE;
else return FALSE;
}
if (not len(form.eventTitle)) foo = arrayAppend(variables.error, "Please enter a name for this event");
if (not len(form.summary)) foo = arrayAppend(variables.error, "Please enter a brief description of this event");
if (not len(form.body)) foo = arrayAppend(variables.error, "Please enter a full description for this event");
if (not len(form.location)) foo = arrayAppend(variables.error, "Please enter a description of the location for this event");
if (not len(form.contactName)) foo = arrayAppend(variables.error, "Please enter your contact name");
if (not len(form.company)) foo = arrayAppend(variables.error, "Please enter your company name");
if (not len(form.jobTitle)) foo = arrayAppend(variables.error, "Please enter your job title");
if (not len(form.email)) {
foo = arrayAppend(variables.error, "Please enter your email address");
} else if ( not IsEmail(form.email) ) {
foo = arrayAppend(variables.error, "Your email address does not appear to be formatted correctly.");
}
}
SET NOCOUNT ON
INSERT INTO tblEvents (eventTitle, summary, body, location, URL, contactName, company, jobTitle, email, userID, dateFrom, dateTo)
VALUES (
,
,
,
,
,
,
,
,
,
,
,
)
SELECT @@IDENTITY AS eventID
SET NOCOUNT OFF
Thank you for sending us your event. If approved, your event details will be added to our Events section within the next few days.
Credit Today
#Application.vRoot#A user has added an event via the Credit Today website:
Event Title: #form.eventTitle#
Summary: #form.summary#
Full details are available here:
#Application.vRoot#secure/diaryevents/event.cfm?eventID=#AddItem.eventID#
Diary of events : Add Event
Thank you, your details have been successfully received.