![]() | * 3 Months FREE * CLICK HERE! | |
| CoverYourASP --> Implementing forms with ASP --> Part 4 | ||
| <form> inputs
Having opened the <form> tag, my next job is to send out some <input> tags. The type attribute defines the type of input (obviously!) - there are many choices, only two of which I shall demonstrate here. For more information on the <form> and <input> tags, visit the best online HTML reference I've found - the Web Design Group type="text" provides us with a simple text entry box. name="name" is a poor example to use (oops), maybe name="yourname" makes it a little clearer - yourname is the name you use to retrieve the data from the Request.Form collection when the form is submitted. size="10" suggests to the browser that only 10 characters should be displayed on the form, although you can enter more characters and the input will scroll. (maxlength="10" would suggest a maximum length, but don't rely on that) Lastly, the value attribute defines the initial value of the input. I always pass in the variable values, which is why I initialized them to default values, then updated them when the form was submitted. If the validation fails the form will then reappear with all the same information present in the form!
Here's another example - the submit button. You can define the text on the button using the value attribute. That's all there is in this simple form, so the closing <form> tab follows. All that is left now is the processing of the data on the form! |
| ||||||||||||||||||||||||||||||||||||||||||||||||||