One, the overview that express sheet
The table is simple, the action in the webpage cannot small inspect, basically be in charge of the function that data collects, the name of the person that for instance you can collect a visit and E - Mail address, questionnaire, visitors' book is waited a moment.
1, the composition that expresses sheet
Sheet of a watch has 3 main component:
- Express single ticket: The URL that processing included to express odd number to use CGI program according to place inside this and data submit the method of the server.
- Express only region: Contained text casing, password draw a frame round, conceal casing of text of region, much travel, answer choose casing, sheet to choose casing, next pulling choice casing and file upload casing to wait.
- Express single button: Include to refer pushbutton, restoration pushbutton and common button; The CGI script that is used at sending number to the server as it is said perhaps cancels an input, still can use the pushbutton that express sheet to control other definition the processing that handles script works.
< of > of Form of < of the 1.1 label that express sheet / Form >
Function: Express sheet with Yu Shenming, the definition gathers the range of data, namely < Form > and < / the data that includes inside Form > will be referred to the server or in email.
Syntactic: < FORM ACTION="URL" METHOD="GET | POST" ENCTYPE="MIME" TARGET=" . . . .. ? . . < / FORM >
Attribute explanation sees next tables:
| Action=url | Appoint will treat the form that submits watch sheet. It can be an URL address (submit form) or an email address. |
| Method=get or Post | Demonstrate submits the HTTP method that expresses sheet. Potential value is:
|
| Enctype=cdata | When demonstrate uses a watch sheet to refer a server (the Internet media form that is "post") when Method value. This characteristic default value is "application/x-www-form-urlencoded " |
| TARGET=" . . . .. | Appoint the position that referred result documentation indicates:
|
For example:
> of < Form Action="http://www.yesky.com/test.asp" Method="post" Target="_blank" . . . < / Form >
Express to express sheet to will be referred with the means of Post to Http://www.yesky.com/test.asp, referred result shows in new page, the media way that data refers is acquiescent Application/x-www-form-urlencoded means;
The 1.2 region that express sheet
The region that express sheet contained casing of text of text casing, much travel, password draw a frame round, conceal region, answer choose casing, sheet casing mixes next pulling to choose casing to wait, use at collecting the data of the input of the user or choice, the code format of these region that express sheet tells about respectively below:
1.2.1 text casing
Text casing is a kind of him person that allow a visit the object expressing sheet that inputs content, be used to normally fill in the answer with single brief perhaps word, be like full name, letterhead.
Code format: < Input Type="text" Name=" . . . .. Size=" . . . .. Maxlength=" . . . .. Value=" . . . .. ?
Attribute explanation:
Type="text" defines one-way text to input casing;
Name attribute defines the name of text casing, what should assure data is accurate collect, must define an unique name;
Size attribute defines the width of text casing, the unit is single character width;
Maxlength attribute defines the character number of most input.
Value attribute defines the initiative value of text casing
Sample 1:
Sample 1 code:
> of < Input Type="text" Name="example1" Size="20" Maxlength="15"
Casing of many 1.2.2 text
Also be a kind of him person that allow a visit the object expressing sheet that inputs content, the person that just can allow a visit fills in longer content.
Code format: < TEXTAREA Name=" . . . .. Cols=" . . . .. Rows=" . . . .. Wrap="VIRTUAL" > < / TEXTAREA >
Attribute explanation:
Name attribute defines the name of casing of much travel text, what should assure data is accurate collect, must define an unique name;
Cols attribute defines the width of casing of much travel text, the unit is single character width;
Rows attribute defines the height of casing of much travel text, the unit is single character width;
Wrap attribute definition inputs the pattern that when content is more than text region, shows, optional value is as follows:
- Acquiescent value is text automatic line feed; The meeting when the right border that exceeds text region when input content turns automatically to next group, and the place of automatic line feed when data is being referred to handle won't have line feed accord with to appear;
- Off, with will avoid text line feed, when the content that should input exceeds bound of text region right, text rolls towards the left, must use Return ability to will insert a dot move to next group;
- Virtual, allow text version automatic line feed. The meeting when the right border that exceeds text region when input content turns automatically to next group, and the place of automatic line feed when data is being referred to handle won't have line feed accord with to appear;
- Physical, let text line feed, when data is referred to handle line feed accord with also will be referred to handle together.
Sample 2:
Sample 2 code:
< of > of < TEXTAREA Name="example2" Cols="20" Rows="2" Wrap="PHYSICAL" / TEXTAREA >
1.2.3 passwords casing
It is a kind of special text region, use at inputting a password. When the person that visit inputs a character, the character can be replaced by asterisk or other symbol, and the character of the input can be concealed.
Code format: < Input Type="password" Name=" . . . .. Size=" . . . .. Maxlength=" . . . .. ?
Attribute explanation:
Type="password" defines password casing;
Name attribute defines the name of password casing, what should assure data is accurate collect, must define an unique name;
Size attribute defines the width of password casing, the unit is single character width;
Maxlength attribute defines the character number of most input.
Sample 3:
Sample 3 code:
> of < Input Type="password" Name="example3" Size="20" Maxlength="15"
1.2.4 conceal region
Concealing region is to use the sightless element that collect or sends message, to the visit person of the webpage, concealing region is invisible. When when the watch sheet is referred, the name that conceals the definition when region can use information you to install and value send a server to go up.
Code format: < Input Type="hidden" Name=" . . . .. Value=" . . . .. ?
Attribute explanation:
Type="hidden" definition conceals region;
Name attribute defines the name that conceals region, what should assure data is accurate collect, must define an unique name;
Value attribute defines the cost that conceals region
For example: > of < Input Type="hidden" Name="ExPws" Value="dd"
1.2.5 answer choose casing
Answer the option of an above in choosing casing to allow to be chosen in needing option. Every answer the element that choosing casing is an independence, must have an unique name.
Code format: < INPUT Type="checkbox" Name=" . . . .. Value=" . . . .. ?
Attribute explanation:
Type="checkbox" is defined answer choose casing;
Name attribute is defined answer the name that picks casing, what should assure data is accurate collect, must define an unique name;
Value attribute is defined answer the cost that picks casing
Sample 4: Yesky.com Chinabyte.com
Sample 4 code:
Yesky.com of > of < Input Type="checkbox" Name="yesky" Value="09"
Chinabyte.com of > of < Input Type="checkbox" Name="Chinabyte" Value="08"
1.2.6 sheet choose casing
The person that visit when need is when the solution with the only alternative in needing option, use sheet to choose casing with r espect to need.
Code format: < Input Type="radio" Name=" . . . .. Value=" . . . .. ?
Attribute explanation:
Type="radio" defines sheet to choose casing;
Name attribute defines sheet to pick the name of casing, what should assure data is accurate collect, sheet choosing casing is with group use for the unit, the only option in same group must be used same a name;
Value attribute defines sheet to pick the cost of casing, in same group, their region value must be different.
Sample 5: Yesky.com Chinabyte.com
Sample 5 code:
Yesky.com of > of < Input Type="radio" Name="myFavor" Value="1"
Chinabyte.com of > of < Input Type="radio" Name="myFavor" Value="2"
1.2.7 files upload casing
Occasionally, need user uploads his file, the file uploads casing looks and other text region is about the same, it is it still included a button that browse only. The method of the file that the person that visit can upload through inputting need perhaps clicks the pushbutton that browse to choose to need uploading document.
Attention: It is before use file region, whether does the server that decides you first please allow faceless upload a file. ENCTYPE="multipart/form-data" must be installed to ensure the file is coded correctly in the label that express sheet; Additional, the deferent kind that expresses sheet must install POST.
Code format: < Input Type="file" Name=" . . . .. Size="15" Maxlength="100" >
Attribute explanation:
Type="file" defines a file to upload casing;
Name attribute defines a file to upload the name of casing, what should assure data is accurate collect, must define an unique name;
Size attribute defines a file to upload the width of casing, the unit is single character width;
Maxlength attribute defines the character num ber of most input.
Sample 6:
Sample 6 code:
> of < Input Type="file" Name="myfile" Size="15" Maxlength="100"
1.2.8 draw choice circle
Choice casing is pulled to allow you to install a variety of option in a limited space below.
Code format:
< Select Name=" . . . .. Size=" . . . .. Multiple >
< Option Value=" . . . .. Selected > . . . < / Option >
. . .
< / Select >
Attribute explanation:
Size attribute defines next pulling to choose the linage of casing;
Name attribute defines next pulling to choose the name of casing;
Multiple attribute expresses to be able to be chosen more, if do not install this attribute, so can odd anthology;
Value attribute defines the value of options;
Selected attribute states acquiesce has chosen this option.
Sample 7:
Sample 7 code:
> of < Select Name="mySel" Size="1"
< of Yesky.com of > of < Option Value="1" Selected / Option >
< of Chinabyte.com of > of < Option Value="d2" / Option >
< / Select >
Sample 8:
Press Ctrl to be able to be chosen more
Sample 8 code:
> of < Select Name="mySelt" Size="3" Multiple
< of Yesky.com of > of < Option Value="1" Selected / Option >
< of Chinabyte.com of > of < Option Value="d2" / Option >
< of Internet.com of > of < Option Value="3" / Option >
< / Select >
The 1.3 pushbutton that express sheet
Express what only pushbutton control expresses sheet to run.
1.3.1 refer pushbutton
Refer pushbutton to refer a server wit h the information that will will be inputted.
Code format: < Input Type="submit" Name=" . . . .. Value=" . . . .. ?
Attribute explanation:
Type="submit" definition refers pushbutton;
Name attribute defines the name that submits pushbutton;
Value attribute defines the indication character of pushbutton;
Sample 9:
Sample 9 code:
< Input Type="submit" Name="mySent" Value=" sends " >
1.3.2 restoration pushbutton
Restoration pushbutton uses replacement to express sheet.
Code format: < Input Type="reset" Name=" . . . .. Value=" . . . .. ?
Attribute explanation:
Type="reset" defines restoration pushbutton;
Name attribute defines the name of restoration pushbutton;
Value attribute defines the indication character of pushbutton;
Sample 10:
Sample 10 code:
< Input Type="reset" Name="myCancle" Value=" cancels " >
1.3.3 common button
Common button uses control other the processing that defined processing script works.
Code format: < Input Type="button" Name=" . . . .. Value=" . . . .. OnClick=" . . . .. ?
Attribute explanation:
Type="button" defines common button;
Name attribute defines the name of common button;
Value attribute defines the indication character of pushbutton;
OnClick attribute, also can be the incident of other, will define the conduct of pushbutton through assigning script function;
Sample 11:
Sample 11 code:
< Input Type="button" Name="myB" Value=" saves " OnClick="javascript:a> of Lert('it Is A Button')"

No comments:
Post a Comment