Sams Teach Yourself HTML 4 in 24 Hours

Sams Teach Yourself HTML 4 in 24 Hours

By Dick Oliver

Workshop

Quiz

  1. What do you need to get from the people who administer your Web server computer before you can put a form on the Internet?
  2. Write the HTML to create a "guestbook" form that asks someone for his or her name, sex, age, and email address. Assume that you have a form-processing script set up at /cgi/generic and that you need to include the following hidden input element to tell the script where to send the form results:
            <input type="hidden" name="mailto" value="you@yoursite.com" />
    
  3. If you had created an image named sign-in.gif, how would you use it as the Submit button for the guestbook in question 2?

Answers

  1. The Internet address of a script or program that is set up specifically to process form data.
  2. <html><head><title>My Guestbook</title></head>
    <body>
    <h1>My Guestbook: Please Sign In</h1>
    <form method="post" action="/cgi/generic">
    <input type="hidden" name="mailto" value="you@yoursite.com" />
    Your name: <input type="text" name="name" size="20" /><p>
    Your sex:
    <input type="radio" name="sex" value="male" /> male
    <input type="radio" name="sex" value="female" /> female<p>
    Your age: <input type="text" name="age" size="4" /><p>
    Your e-mail address:
    <input type="text" name="email" size="30" /><p>
    <input type="submit" value="sign in" />
    <input type="reset" value="erase" />
    </form>
    </body></html>
    								
  3. Replace

    <input type="submit" value="Sign In" />
    

    with

    <input type="image" src="sign-in.gif" />
    

Exercise

  • Create a form using all of the different types of input elements and selection lists to make sure you understand how each of them works.

Share ThisShare This

Informit Network