ASP/.NET Web Hosting
* 3 Months FREE *
CLICK HERE!
 CoverYourASP --> Implementing forms with ASP --> Part 4

Free membership

Join in the fun! Sign in
Member Services

Site navigation
Download the entire site!
Search my articles
Free Magazines
Browse the directory

Send me feedback
Buy my boxer shorts

Recommend this page
Printer-friendly page

Resources I recommend
Link to my site
Advertising slashed!
About your privacy
Legal stuff
Site statistics
76 active users
3317 visitors today
4611 pages today
how is this done?
Tools I use

CoverYourASP
Copyright © 1999-2008 James Shaw.
All rights reserved.

ASP.NET Blog
RSS submissions
E-commerce

Now open source with SourceForge!

<form> inputs

Out ( 'Name: ' );

Out ( '<input type="text" name="name" size="10" value="' + sName + '">' );

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!

Out ( '<input type="submit" value="Display name">' );

Out ( '</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!

Part 5: Processing the data...

Featured sponsor
My favorite resources

Tiki Statues - Tiki Masks - Tiki Totems



Qualify for Free Trade Magazines

Free subscriptions to industry leading publications for those who qualify!


New Proposal Kit Professional 5.1
Brand yourself as a top professional: create quotes and amazing proposals and get many legal documents free!

The latter saved me 3 times the purchase price on the first day I owned it!