HTML form form element various input elements common elements synthesis case

Source: Internet
Author: User

Html Table Element , main purpose : user input data, and submit to the server

the basic syntax is :

<form action= "url" (refers to who submits the form to) method= "submitted method (get/post), default is get" >

Various input elements "input box, drop down list, text field, Password box"

</form>

Case Study: Login interface

Login.html

<HTML><Head><title>Login interface</title></Head><Body><formAction= "ok.html"Method= "Get">User name:<inputtype= "text"name= "username" /><BR/><!--space entity, or full-width space -Dense&nbsp;Code:<inputtype= "Password"name= "pwd"/><BR/><inputtype= "Submit"value= "Login"/>&nbsp;&nbsp;<inputtype= "Reset"value= "Re-fill"></form></Body></HTML>

Ok.html

< HTML > < Body > Landing Success </ Body > </ HTML >

Run :

Basic syntax of the form <form action= "url" method=*>

...
...
<input type=submit> <input type=reset>
</form>

Input forms available to users in the form

<input type=* name=**>

*=text, password, checkbox, radio, image, hidden, submit, reset

**=symbolic Name for CGI script

*=get, POST

(1) Format of form elements

<input type=* name=**/>

type= Text [ textbox ]&NBSP; , password [ Password box ]&NBSP; , hidden [ hidden Fields ]&NBSP; , checkbox [ check box ]&NBSP; , Radio [ Radio box

Submit [ submit button ] , Reset [ Reset button ] , image[ Picture button ]

Name is the form element you named

(2) Action specifies which pages to submit these requests to

Action The general submission is servlet,jsp file

Post does not display the submission in the Address bar

Get will display the user name and password submitted but the address bar

The picture can also be made into a submit button

<input type= "image" src= "girl.jpg"/>

Value is the word that is displayed on the button

INPUT Element Example

<HTML><Body>************ text box with Password box ************<BR/>Name:<inputtype= "text"value= "Please enter first name"name= "username"/><BR/>Password:<inputtype= "Password"name= "pwd"/><BR/><BR/>************ check box (like fruit) ************<BR/><!--name to remain consistent -<inputtype= "checkbox"name= "V1">Watermelon<BR/><inputtype= "checkbox"name= "V1">Apple<BR/><BR/>************ Radio Box (choose Gender) ************<BR/><!--name to remain consistent -<inputtype= "Radio"name= "Sex">Man<BR/><inputtype= "Radio"name= "Sex">Woman<BR/><BR/>******* Hidden (his use is mainly to submit data, without affecting the layout of the interface) * * * *<BR/><inputtype= "hidden"value= "123"name= "Sal"/><BR><BR/>************ drop-down selection (please select your place of birth) ************<BR/><Selectname= "Biradd"><optionvalue="">--Please choose--</option><optionvalue= "Beijing">Beijing</option><optionvalue= "Shanghai">Shanghai</option><optionvalue= "Chongqing">Chongqing</option></Select><BR/><BR/>***************** text field (please leave a message) *************<BR/><textareacols= " the"rows= "Ten">Please enter here ...</textarea>  <BR><BR/>*********** File Control (select the file you want to upload) ********<BR/><inputtype= "File"name= "MyFile"/>Please select a file<BR><BR/></Body></HTML>

Display effect:

HTML form form element various input elements common elements synthesis case

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.