Friday, May 28, 2004

Atlas Workshops

Almost forgot about this one. Spent the better part of two weeks getting the site ready for the addition of information and applications regarding the new scholarships being offered. Created a new form mailer so that I don't have to spend all my time creating scripts to handle any forms that we use on our site. I'm sure I'll still be spending a good amount of time on these, but at least now I can quickly create forms that require nothing more than that the information be passed along to a staff member.

The form can be fairly simple and only requires a few fields for the mailer to operate on it. However, the mailer is also capable of more complex tasks such as data validation. A number of hidden fields must be included for each form object that needs the validation, so a little more effort is required to create the form in this respect. But the payoff in processing time should be great. I hope I'll get an opportunity to use it often. A brief overview of the required and optional fields and what they do.

In order to use this script the submitting form must contain the following elements:
Hidden Field: ctrl_bolValidated (0)
Hidden Field: ctrl_bolProcess (1)
Hidden Field: ctrl_strRecipient (email address)
Hidden Field: ctrl_strSubject (text)

The form can be designed without any modifications to the structure of the form. However, user form fields also require the following information hidden form fields to enable processing:
ctrl_fieldname_userfield (1)
ctrl_fieldname_type (1=string,2=number)
ctrl_fieldname_required (1=yes,0=no)
ctrl_fieldname_format (only for string values, currently available: NUL=no format,EML=email address)
ctrl_fieldname_friendlyname (text, displayed if something is wrong with the field)

Optional fields to aid in processing the data and to provide a success message and confirmation email:
Hidden Field: ctrl_strSuccessMsg (text)
Hidden Field: ctrl_strSuccessLink (URL)
Hidden Field: ctrl_strOrdered (list of field names, these will be listed in order specified in the e-mail, all others will be listed in order provided by the Request object)
Hidden Field: ctrl_bolConfirm (1, Send an e-mail confirmation to the user)
Hidden Field: ctrl_strConfirmSubject (text, subject of the email confirmation)
Hidden Field: ctrl_strConfirmBody (text, contents of the email confirmation)

For any other field on the form, the "ctrl_" prefix will prevent those fields from showing up in the results e-mail.