Monday, October 26, 2009

Play easily turn pattern table is simple- - the overview that express sheet

This special subject from most the knowledge of the foundation that express sheet, to the advanced application that expresses sheet, let you have knowledge of a more comprehensive ground, after believing you are reading this special subject, regular meeting is odd to expressing very familiar.

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.
For attend to different webpage designs a tool, the article tells about the design of code only, not specific tell about operation method, the HTML code that sheet expresses namely below designs a point:

< 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:
  1. Post: POST method includes a name in the main force that expresses sheet / in the value is opposite and need not including the URL at Action character.
  2. Get: Deprecatory. GET method the name / the value is to adding at the back of the URL of Action and send new URL to the server. This is forth compatible default value. This value is disapproved of as a result of the reason of internationalization use.
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:
  1. _blank: In new, anonymous browser window transfers into designation documentation;
  2. _self: Transfer into in the does not have element same framework that points to this target documentation;
  3. _parent: Transfer into documentation the direct father of current draw a frame round in FRAMESET casing; This value is equal in value when current draw a frame round does not have father casing at _self;
  4. _top: Transfer into documentation original most in the browser window of coping (cancel) of all other frame accordingly; This value equivalence does not have the _self when your casing at current draw a frame round.


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