Skip to content

Online Forms

Usually creating web forms requires a knowledge of web programming. To simplify this process, a program is available on the main University web server which provides a means of creating simple online forms without the need for additional programming.

In programming terms, the program is a web form to email gateway installed on the main University web server. It can be used to email the values that people enter into a web form. This can be useful if you do not want to use a specialised CGI program to handle the data.

The form mailer allows an email to be sent to a specified recipient when someone submits an online form. It takes details entered on the form, which could be information ticked in boxes, selected from a drop-down menu, or typed in a text field, and sends it to the specified recipient as an email. When the form is submitted, Willimail also displays a summary of the information entered for the person submitting the form.

Why Use the University Online Forms System?

It is a simple tool that does a simple job. For customised output based on the input of a form, or reports based on the values people enter, it is necessary to have a custom CGI program written to handle the form.

University online forms can be created to work on University of Adelaide TMS websites, with the details of creating the form differing only slightly depending on the style of templates used for the site.

Some things to consider when using University Online Forms:

  • Email Delivery Restrictions
    Form output will not deliver email to addresses outside the university's domain, and those of a few other affiliated organisations. This stops the form being abused to send SPAM outside the university.
  • Human Verification
    To reduce University forms being used for spam, a setting is available which will cause the program to note the origin of any form submissions, and if outside the university's network, may present the user with a simple challenge such as an arithmetical question, e.g. "What is two hundred and thirty five minus four?". The user must answer correctly before any email is sent. This helps to prevent SPAM being sent to recipients within the University.
  • File Upload Restrictions
    All files attached to the form for uploading can not be larger than 20MB in total. This helps to prevent denial of service attacks that may attempt to flood our system with data.

Please contact the Web Team if you would like any assistance in using the University online forms system to create forms from within your tms website.

Human Verification

Adding a line into the tms.conf file for a site will cause the verification to be used for all forms within the site:

willimail_captcha = text

This verification mechanism will only come into play when the form is filled in from a computer outside the university network. In order to try it out inside the network, you can add the following to the form being tested:

<input name="willimail_captcha" value="1" type="hidden">

Creating Online Forms in TMS Sites

To use the program, set up a form using Dreamweaver or HTML editor of your choice, using the "POST" method for submissions. The source should look like this:

<form name="formname" method="post" action="">

and you should also include a hidden field specifying the handler for the content

<input type="hidden" name="handler" value="willimail">

As tms pages need only contain the content and do not require to pageheader , etc. to be specified because they are determined by the templates, you do not need to specify those hidden fields when creating forms for tms sites.

Notes: Do not attempt to create a form that uses a " mailto :" action field for the form, such as:

<FORM action="mailto:user@adelaide.edu.au">
...
</FORM>

Although this may work on some browsers, many do not support it and even those that do appear to work may fail to send the information if the email client hasn't been setup correctly. Imagine how annoying it is for someone to spend a large amount of time filling in a form and then not being able to submit. For that reason, please use the standard University online forms system.

And finally, please remember to test that your form works before asking people to fill it in!

Hidden Fields

Once the basic form has been created, "hidden" fields need to be added to the form for the program to work correctly. Dreamweaver supports adding hidden fields to a form, however if you are using TMS you will have to edit the HTML code directly to add these. The following hidden fields can be used within the form tags to customise the form. In this context, when a field is said to have a 'true' value, it must have a value that is not an empty string, and not 0 (zero). Note that by default, only recipient and subject are required fields.

hidden field name value
handler (required) value=" willimail " instructs the form handler to process this as a University online form.
recipient (required) The recipient of the email containing the form results. To send the mail to more than one address, list them all, separated by commas.
subject (required) The text to appear as the "Subject" in the email sent with the form results.
cc This field is either a form field name, or a comma separated list of email addresses. If it is a field name, the value of that field is expected to be a (possibly empty) comma separated list of email addresses. Whether the addresses are obtained indirectly or literally, they will be sent a "carbon copy" of the form submission.
redirect Used as the page to go to when the form is submitted. Either a complete URL or one that is relative to the web server (eg. "/research/feedback/thanks.html") must be entered for this field to work. If this field is not specified, a standard page appears displaying the values entered on the form and optionally providing a link to follow (see above). Do not specify this field unless the page to which it refers exists.
title This form field allows you to specify the title and heading that will appear at the top of the resulting page if you do not specify a redirect URL.
sort This field allows you to choose the order in which you wish for your variables to appear in the e-mail that FormMail generates. You can choose to have the field sorted alphabetically or specify a set order in which you want the fields to appear in your mail message.
print_config This field allows you to specify which of the config variables you would like to have printed in your e-mail message.
required A comma separated list of form element names. If any of the fields in the list are not filled in, the program will reject the form, instructing the user to go back and fill in the missing section. See also client side validation below.
remove_fields A comma separated list of form element names. The fields in this list will not be shown in your e-mail message.
missing_fields_redirect A URL to be displayed when required fields have not been entered. This operates similarly to the redirect parameter above.
return_link_url A URL to offer the person to follow as a link after they've submitted the form - If you include this field, you must also include return_link_title (see below).
return_link_title Used as the title in the back link generated by return_link_url.
print_blank_fields This field allows you to request that all form fields are printed in the return HTML, regardless of whether or not they were filled in. If you use this, you also need to include at the top of the page:

<!--WFINC="filter(class=RegisterForm)"-->

This ensures that checkboxes and radio button fields are also included in the results. The value must equal "1" for this feature to work. e.g.  <input name="print_blank_fields" value="1" type="hidden">
results_custom_html The URL of a page with additional information to be displayed on the page shown after the form has been submitted.
willimail_csv When this value is true then the attached values file will be in comma separated values format, instead of the default tab separated values.
willimail_notsv When this value is true then there will not be a values file (either TSV or CSV) attached to the email.
willimail_timestamp value="date_submitted" will fill in the field with the time of submission.

Client Side Validation

Using standard validation means that if users fill out one field incorrectly they will have to press the back button and fill out all the fields again. We recommend you also add client side navigation which is by default included in all form samples below.

Special Fields

Optionally, if you want the output email sent to you to appear as if it had come from the person filling in the form, then you can use special form elements named " realname " and "email" as shown below.

Name: <INPUT type="text" name="realname"> Email: <INPUT type="text" name="email">

The name and email address which appear on the email are set to the values entered by the person filling in the form and depend on them entering these details correctly. It is recommended that these fields be made required entries, using the required hidden field described above.

Auto Generated LDAP Field Content

If you have restricted access to a form and require the user to login , you can use the following field code to automatically generate the data for that field. This is useful for people's names, emails etc.

Data That Will Populate Field Code
Email <input type="text" disabled="disabled" value="<!--WFINC='session(email)'-->">
Given Name <input type="text" disabled="disabled" value="<!--WFINC='session(givenname)'-->">
Surname <input type="text" disabled="disabled" value="<!--WFINC='session(sn)'-->">
User ID <input type="text" disabled="disabled" value="<!--WFINC='session(uid)'-->">

Please contact the Web Team if you would like any assistance in using the University online forms system to create forms from within your TMS website.

Files Submissions

It is sometimes useful to allow people to attach a file when submitting a form. For example, you may want people to be able to attach an image of themselves with the form information.

The University online form system handles these file uploads, if you include the enctype in the form tag, for example:

<form method="post" action="" enctype="multipart/form-data">

Then you can have a field for the file to be included in the email as an attachment, for example

<input type="file" name="attachedfile">

Please contact the Web Team if you would like any assistance to create forms from within your website.

Sample Forms

New Template - Please see the forms section in the Pattern Library for more information and pattern access.

Sample forms for the old template are available for viewing below or you can contact the Web Team for assistance in setting up a form.

 

 

Web Team

Call us: For urgent requests or to speak with someone directly,
please contact one of our team members.
 
Not sure how to do something? Take a look at our FAQs.