Click to skip over navigation
 

lecture 9: mailto processing

<< previous slide

return to lesson 9 index

next slide >>


Any "genuine" form - in other words, one that has been placed on a site to gather information, rather than being purely decorative - must be processed. Processing, to put it in the simplest possible terms, is what happens when the user presses the Submit button. If, for whatever reason, a form does not have a Submit button, it doesn't need processing.

Unfortunately, with processing, we reach one of those points where I can introduce a topic, but not do much more than that. There is a very simple method of processing a form which I will describe on this slide, but it is limited in application as it doesn't enable you to then dynamically construct a page based on the contents of the form. To do that you need to engage with an advanced web technology known as CGI, which I will introduce on the next slide.

The simple way to process a form is just to send it by e-mail. All form processing is handled by the <form> tag. Up until now this has just seemed like a "container" for form elements and little more, but in fact it's the key to the whole process. A "full" <form> tag could look something like this:

<form action="mailto:drew@leeds.ac.uk" enctype="text/plain" method="post">

When Submit is clicked, the browser will then send a mail to the address noted in the action attribute which will look something like this. What you are seeing below are the name/value pairs of this form (and note the multiple ones for check boxes). What you then do with this e-mail is up to you: it is out of the web site's jurisdiction, if you like.

Image: mail output from a simple form

Although there's no real interactivity possible with this method and it still requires the recipient of the e-mail to put in a bit of legwork, it's a straightforward and simple way of processing a form...

...except that there are problems with it working on the university system. As with mail-to links, you really need to be already logged into the WebMail service for it to work properly. Rest assured, though, that as long as your <form> tag is correct (and see the online materials for more information here), the form will work fine for people at home who will have a more conventional e-mail client.




<< previous slide

return to lesson 9 index

next slide >>