Forms allow your visitors to communicate with you. They are thus very cool as make your site more interactive! You can do forms in one of two main ways. One is to have the form automatically send the input direct to you via a mailto link. The other has the input dealt with server-side, and involves the use of CGI scripts (which are run using a PERL programme on your ISP's, or web host's, server). The latter require your provider to have the necessary stuff "on" their server in the first place, to be able to do this, and is a lot more complicated, so I will initially deal with "mailto" type forms here, until I learn more about the CGI ones myself! You can find out more about the CGI type forms (or those using JavaScript, as well) if you go to the Wicked Links page.
IMPORTANT: Using the "Mailto" form method is NOT secure, thus anybody can intercept and read the information that a user input on such a form, once it is submitted to you. So NEVER ask visitors to type anything confidential (if they are sensible they wouldn't do it anyway!). If you need a secure form, you will be needing to learn about CGI ( ) and SSL (Secure Socket Layer) which are out of the scope of this tutorial at the moment! So the type of form I show is purely for, e.g. guest books, okay?!
You start off by using the FORM
element, which can have various attributes. Best
thing is if I design bits of a form, then below each bit, I will show you the code used to
do it! DONT fill the form in - I have done it merely as an example: if you try to press
"submit", you may get an error on your computer!! If you want to fill in a
real form that works - well, just go and play around in my
Guestbook instead!
</FORM>
Now, if I were you, I would play around with all the different bits of the code above to get
the hang of them. If you want to cheat, have a look at the source code behind my
Guestbook page! This may well be easier to follow than pulling
the code from above. Also, just remember that you can put any HTML (e.g. text formatting)
tags within the FORM
elements, so you can use tables to tidy up the presentation
of your forms, different text, you name it!
COPYRIGHT INFORMATION: All Rights Reserved. No part of this HTML tutorial may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior permission of the copyright owner, Didi Austin, who may be contacted using the link below.