Forms - part 4


© Oisin Prendiville

reset that form
Sorry about the delay with this final article in the "forms" series. This month I spent 2 weeks in Portugal on holidays with my family. When I returned it was my birthday and I spent a few days celebrating with different friends in different parts of the country. Last week I received the results of those exams that delayed previous articles and thankfully all my study had paid off as I received 4 A's and 3 B's. So that deserved a night or two of celebrating also.

But as much as you must be interested in my life I'm sure you would refer t finish learning about forms.

There are two buttons that you will generally find at the bottom of each form - one of them is really necessary.

The first is the "reset" button which quite simply resets everything in the form to its original value (i.e. the form will look identical to how it looked when the page was first loaded.

The code for this button is:

<input type="reset" value="Reset the Form">

The value attribute sets the text that will appear on the button. The image shows what this button will look like on Internet Explorer.

The other button is the "Submit" button. Before discussing this button I will tell you the ways you can get the information from the form.

Remember the <form> tag that we use to show the start of the form. Well this tag is also used to tell the computer what to do with the content of the form when it is submitted.

In my other tutorial I only discussed submitting a form by email. I will teach this here but will also discuss an alternative.

<form action="mailto:me@myhouse.com" method=post>

It's as simple as that. Simply change me@myhouse.com to your own email address and when the user clicks on the Submit button (I'll discuss this in a few minutes) the contents of the form will be sent directly to your email address. Don't worry about the method attribute; just make sure to add it in as shown.

However this does not work with every browser, particularly the older ones (Internet Explorer 3/3.01). It is not ideal.

Also the information in the email will be received as an attachment, which needs to be opened in some sort of text editor. When you do open it, it will still be difficult to read. All of the information is printed as one line of text and there are no spaces.

reset that form
       

Go To Page: 1 2 3


The copyright of the article Forms - part 4 in HTML Lessons is owned by . Permission to republish Forms - part 4 in print or online must be granted by the author in writing.

Post this Article to facebook Add this Article to del.icio.us! Digg this Article furl this Article Add this Article to Reddit Add this Article to Technorati Add this Article to Newsvine Add this Article to Windows Live Add this Article to Yahoo Add this Article to StumbleUpon Add this Article to BlinkLists Add this Article to Spurl Add this Article to Google Add this Article to Ask Add this Article to Squidoo


Here's the follow-up discussion on this article: View all related messages

1.   Nov 7, 2000 8:29 PM
I liked your series on creating forms. It was one of the last HTML skills I learned how to do, because most tutorials just told me how to submit using CGI. First, I didn't know how to get access to a ...

-- posted by ahunter





For a complete listing of article comments, questions, and other discussions related to Oisin Prendiville's HTML Lessons topic, please visit the Discussions page.