WCS: Forms on web.mit.edu


This document (http://web.mit.edu/cwis/docs/comments-doc.html) presents quick instructions for making forms that are sent as email using the server web.mit.edu. It assumes you have access to an Athena account to generate the first form.

If all you want to do is to generate a simple e-mail comments form (sample here), you need only follow steps 2, 7, and 9.

For more general information about how forms work on web.mit.edu, please see the Forms FAQ.


  1. To learn the HTML coding for a fill-out form, read:

    Quick Guide compiled at MIT

    NCSA's fill-out-form guide (more detailed information) is at
    http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/Docs/fill-out-forms/overview.html

    This is going to be the biggest part of the work. You need to know how to write forms in HTML, knowing about INPUT, NAME, VALUE, etc. See Pay special attention to the examples at the bottom of the page.

  2. Forms on web.mit.edu require two files: an html file, and a corresponding text file. (See examples)

  3. (Optional) To test the form, you may want to modify the recipient of the information, temporarily.

    Look at the the file comments.txt. Be very careful when modifying it, because your form won't work at all if you mess up. Change the address in the "To" field.

  4. Look at the form inputs.

    You'll notice that some of the inputs in comments.html have names that start with "required-". If these inputs aren't filled in, the form is rejected. Other inputs are optional. Look at comments.txt to see where these inputs appear in the processed message that gets emailed to you.

  5. Add your own inputs.

    Using the skills you learned in step 1, start adding inputs to comments.html. Then add the corresponding "[inputname]" where you want it to appear in comments.txt. This works for checkboxes, etc., not just regular text inputs. You can create new inputs that start with "required-" if you want forms to be rejected if those inputs are blank. You can also remove the "required-" from existing inputs to make them optional. Just be sure to change both the .html and the .txt file.

  6. Try it out.

    Try out the form in your favorite WWW browser. If one of your inputs isn't showing up, make sure you typed it exactly the same in comments.html and comments.txt.

  7. Link to the comment form as you would to any other HTML page:

    <a href="comments.html">comments</A>

  8. Modify the recipient of the information again, if you changed it in step 3.

  9. Try it.

    Try your new form to make sure it does what you want it to do.

    Since mkcmtform creates an "Errors-to" line with your email address on it, you will receive a copy of any bounced mail sent via your form. If a problem with your form is causing mail to bounce, make sure all of the header information (particularly the "To:" and "CC:" lines) are correct.

  10. Examples of Forms at MIT

  11. Use comment replies with a database or spreadsheet

    You may want to include the information gathered from a form in a database or spreadsheet program. MIT has developed advanced scripts to simplify this process.

  12. CGI Programs

    If you run your own web server and would like to see the CGI program in C that serves all forms-to-email needs, see the cgiemail page.

Now you're ready to point people at your comments form. There are two other faq pages that you may find useful after creating your first comment form. One is on some advanced scripts that you can use to process comment forms and the other is a general overview of how forms work on Athena.