Use form labels to interact with users

Source: Internet
Author: User
Tags html form

How does a website interact with users? The answer is to use an HTML form (form). The form can transfer the data entered by the browser to the server side, so that the server-side program can process the data that the table only son over.

Grammar:

<form   method= "transfer mode"   action= "Server file" >

Explain:

1.<form>:<form> label is in pairs appear, start with <form>, end with </form>.

2.action: Where the data entered by the browser is transmitted, such as a PHP page (save.php).

3.method: The way data is transmitted (Get/post).

<form    method= "POST"   action= "save.php" >        <label for= "username" > user name:</label>        <input type= "text" name= "username"/>        <label for= "pass" > Password:</label> <input type=        " Password "name=" pass "/></form>

Attention:

1. All form controls (text boxes, text fields, buttons, radio boxes, checkboxes, and so on) must be placed between the <form></form> tags (otherwise the user input information can not be submitted to the server Oh!). )。

2, Method:post/get the difference this part of the content belongs to the back-end programmer to consider the problem.

Example:

<!DOCTYPE HTML><HTML><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"><title>Form Labels</title></Head><Body>   <Div>         <HR/>         <formMethod= "POST"Action= "sava.php">            <label for= "username">User name:</label>            <inputtype= "text"name= "username"ID= "username"value="" />            <BR/>            <label for= "Pass">Password:</label>            <inputtype= "Password"name= "Pass"ID= "Pass"value="" />                <BR/>            <inputtype= "Submit"value= "OK"name= "Submit" />            <inputtype= "Reset"value= "Reset"name= "Reset" />        </form>          <HR/>    </Div>    <Div>        <P>The above is the content of the test</P>    </Div></Body></HTML>

Effect:

Use form labels to interact with users

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.