Share this Page URL

Chapter 12. Need Feedback? Create a Form! > Creating a Form - Pg. 133

Need Feedback? Create a Form! 133 Figure 12.3. A form with a few text boxes. If you run this form (that is, if you click the Just Do It! button), the data is sent to my test script. Why? Because I included the following line: <FORM ACTION="" METHOD="POST"> You'd normally replace this ACTION attribute with one that points to a script that does something useful to the data. You don't have such a script right now, so it's safe just to use my script for testing purposes. Remember that this script doesn't do much of anything except send your data back to you. If everything comes back okay (that is, there are no error messages), then you know your form is working properly. Just so you know what to expect, Figure 12.4 shows an example of the page that gets returned to the browser. Notice how the page shows the names of the fields followed by the value the user entered. Figure 12.4. An example of the page that's returned when you send the form data to my text script. Text boxes also come with the following bells and whistles: · Setting the default value.If you'd like to put some prefab text into the field, include the VALUE attribute in the <INPUT> tag. For example, suppose you want to know the address of the user's home page. To include http:// in the field (because most addresses begin with this), you'd use the following tag: