• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Lesson 11. Creating Forms > Testing Your Forms

Testing Your Forms

You can send a form to an email address even if you don't have a CGI script running on your server. This method should be used only to test your forms.

In the lights_quiz.html document, select the form by choosing <form> from the Tag Selector. In the Action field of the form on the Property inspector, type mailto: followed by your email address.

You should remember to include the colon and no spaces. It should appear as mailto:info@mysite.com with your email address replacing “info@mysite.com”. This is the same way you inserted manual email links in Lesson 3.

Choose POST from the Method drop-down menu and type text/plain into the Enctype text field.

You have set the encode type to plain text; otherwise, the text sent will be encoded into an almost unreadable form.

The enctype defines how the data in the form is encoded. The text/plain value formats the information with each form element on a separate line. Using this value will make it easier to read the results in an email. If you don't define an enctype value, browsers will use a default value that formats the data. Because the default is the one that should be used in most circumstances, you will usually not need to specify an enctype. This example is an exception, because you are sending the data in an email to test the form.


To add a subject line to your form, change the Action to this: mailto:info@mysite.com?Subject=Title for Subject goes here. The ?Subject= defines the text that follows as the subject. You can uses spaces in the subject, but do not use any other special characters such as quote marks, apostrophes, periods, or slashes (other than the ?Subject= that separates the email and the subject) because they will interfere with the HTML code.

This form action might not work in all browsers. Use it only for testing. You should always use a CGI script to send your forms. If your browser is not configured to send email, you will not be able to test this form in this manner.

Save the file and test it in the browser.

You can close this file.



Not a subscriber?

Start A Free Trial

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