• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

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?
A1: The Internet address of a script or program that is set up specifically to process form data.
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" id="mailto" value="you@yoursite.com" />

A2:
<html><head><title>My Guestbook</title></head>

<body>
<h1>My Guestbook: Please Sign In</h1>
<form method="post" action="/cgi/generic">
<input type="hidden" id="mailto" value="you@yoursite.com" />
Your name: <input type="text" id="name" size="20" /><p>
Your sex:
<input type="radio" id"sex" value="male" /> male
<input type="radio" id="sex" value="female" /> female<p>
Your age: <input type="text" id="age" size="4" /><p>
Your e-mail address:
<input type="text" id="email" size="30" /><p>
<input type="submit" value="sign in" />
<input type="reset" value="erase" />
</form>
</body></html>

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?
A3: Replace
<input type="submit" value="Sign In" />

with

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

Exercise

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


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint