Skip to content Accesskey=4Skip to sub-navigation Accesskey=NView our Accessibility Options MIT Information Services and Technology Home About IS&T Contact IS&T Site Map Search Advanced Search
Getting StartedGetting Services by Topic or Alphabetically Getting Help

Web Publishing Reference
 

Web Reference home

MIT Guidelines

Creating Web Pages

 

Web design process
Information Design
Code Standards
Meta tags
Graphics and Color
Printing
Testing
Software
FAQ

Using MIT Web Space

web.mit.edu Resources

MIT/IS&T Resources

Training

Search the Web Reference:

 

Frequently Asked Questions: translateform

Contents


What is translateform?

MIT's general-purpose web server (web.mit.edu) does not allow users to run arbitrary CGI programs. In order to allow users of this server to create web forms, we support the use of the cgiemail script.

translateform is a Perl script that converts an HTML file into a text template file formatted for use with cgiemail. It extracts the all INPUT, TEXTAREA and SELECT tags from forms within the HTML, and arranges them in the template by their field NAME assignments.


How do I use it?

The syntax is:

    add cwis
    translateform foo.html bar.txt
        

Where foo.html contains the actual email form (the html file) and bar.txt is the filename where you want the text template stored. It is important to note that translateform currently does not prompt for email addresses, so these will need to be added by hand in the resulting text file before it can be used by cgiemail.

A simple comment form might result in the following translateform output:

From: [email]
To: INSERT YOUR ADDRESS HERE
Subject: [required-subject]
Errors-To: ccano@MIT.EDU
 
email: [email]
required-subject: [required-subject]
required-body: [required-body]
 
-------------------------------------------------------
Data
 
{begin-record}
[email] {field-separator}
[required-subject] {field-separator}
[required-body]
{end-record}
 
-------------------------------------------------------
NOTE: This message was sent using a WWW form. The address [email]
was typed manually, and may easily be incorrect.
  

Notice the

To: INSERT YOUR ADDRESS HERE

field is not correct. You need to change this to the recipient's email address. Your email address is filled in the Errors-To line. If you want errors emailed elsewhere, you must change this manually. The names in brackets like:

[required-subject]

are the names of the form fields extracted from the HTML file.


What is that Data section?

All the text below the Data section is for use with process-comments, another script available for processing data collected from web forms for inclusion into a database or spreadsheet. If you do not plan on using process-comments, there is a switch that omits the Data section from your output text file. To omit this Data section, use translateform with the -p switch. The command line will look something like:

translateform -p foo.html bar.txt

Leaving it in, however, will not affect anything.


How do I use it with Discuss?

Often times, you will want to archive your form's replies in a Discuss meeting. Just make the To: email address the address of the Discuss email group. For further information about accessing your comments from Discuss, see the process-comments FAQ.


What if I plan to use the form to collect data for a database or spreadsheet?

translateform is often used in conjunction with process-comments to collect data from web forms for inclusion in a database or spreadsheet. The text translateform creates under the Data: section in the translateform output file is used with process-comments to produce tab-delimited files.

Some things to consider if you plan on importing data into a spreadsheet or database are the order and number of fields you are collecting. The order of the fields in the Data: section is the order in which process-comments will arrange its tab-delimited output. If it is important to your application for fields to be arranged in a certain order (and number!) (i.e., if you are appending to existing databases or spreadsheets), you may wish to reorder the fields translateform makes. It is very important that your text file be correct before making your form live on the web, because any errors there will undoubtedly compound themselves later. If you have questions before proceeding, please contact us at web-help@mit.edu.


Are there any known bugs?

There are currently no bugs in translateform. If you encounter any, please send email to web-help@mit.edu.

 

MIT Home | Getting Started | Getting Services | Getting Help | About IS&T | Accessibility
Ask a technology question or send a comment about this web page.

Mit Counter