Workshop


If you've made it this far, I'm sure that you still have a few questions. I've included a few that I think are interesting. Afterwards, test your retention by taking the quiz, and then expand your knowledge by tackling the exercises.

Q&A

Q

I want to create a form and test it, but I don't have the script ready. Is there any way I can make sure that the form is sending the right information with a working script?

A

I run into this situation all the time! Fortunately, getting around it is very easy.

Within the opening <form> tag, modify the action attribute and make it a mailto link to your email address, as in the following:

<form action="mailto:youremailaddress@isp.com" method="post>


Now you can complete your test form and submit it without having a script ready. When you submit your form, it will be emailed to you as an attachment. Simply open the attachment in a text editor, and presto! Your form data is present.

Quiz

1.

How many forms can you have on a web page?

2.

How do you create form controls such as radio buttons and check boxes?

3.

Are passwords sent using a password control secure?

4.

Explain the benefit of using hidden form controls.

5.

What other technology do forms rely on?

Quiz Answers

1.

You can have any number of forms on a web page.

2.

These form controls are created with the input element. Radio buttons have the type attribute set to radio, and check boxes are created using the type checkbox.

3.

No! Passwords sent using a password control are not secure.

4.

Hidden form controls are intended more for you than for the person filling out the form. By using unique value attributes, you can distinguish between different forms that may be sent to the same script or sent at different times.

5.

In order for you to process the data submitted via forms, they must be paired with a server-side script through the action attribute.

Exercises

1.

Ask your ISP for scripts that you can use to process your forms. If you can use them, ask how the data is processed and which names you should use in your form controls. If you need to use forms and your ISP won't allow you to use its scripts, you should start looking elsewhere for a place to host your website.

2.

Visit some sites that might use forms, such as www.fedex.com. Look at which form controls they use and how they arrange them, and peek at the source to see the HTML code.




Sams Teach Yourself Web Publishing with HTML and CSS in One Hour a Day
Sams Teach Yourself Web Publishing with HTML and CSS in One Hour a Day (5th Edition)
ISBN: 0672328860
EAN: 2147483647
Year: 2007
Pages: 305

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net