zoukankan      html  css  js  c++  java
  • 简单清晰的HTML教程

    很不错,

    http://www.w3school.com.cn/html/html_forms.asp

    <html>

    <body>

    <form name="input" action="/html/html_form_action.asp" method="get"/>
    我喜欢自行车:
    <input type="checkbox" name="Bike" value="red" checked="checked">
    <br />
    我喜欢汽车:
    <input type="checkbox" name="Car">

    </br>

    <input type="submit" value="select and submit">

    </form>

    </body>
    </html>

    当点击submit按钮提交表单时,Bike=red 被提交给服务器,

    如果将第二行的checkbox也勾上,那么提交的就是Bike=red&Car=on,Car没有显式给予value值,默认value='on'

    在Karrigell中,QUERY: {'Car': 'on', 'Bike': 'red'}

    <html>

    <body>

    <form name="input" action="/html/html_form_action.asp" method="get"/>
    <select name="cars">
    <option value="volvo">red</option>
    <option value="saab">Saab</option>
    <option value="fiat">Fiat</option>
    <option value="audi">Audi</option>
    </select>
    <input type="submit" value="select and submit">
    </form>

    </body>
    </html>

    运行结果:

    表单 action 演示页面

    您的输入被接受为:

    Sex=female

    该页面是从服务器向您返回的。服务器处理了您的输入,然后返回该应答。

    <html>

    <body>

    <form>
    <select name="cars">
    <option value="volvo">Volvo</option>
    <option value="saab">Saab</option>
    <option value="fiat" selected="selected">Fiat</option>
    <option value="audi">Audi</option>
    </select>
    </form>

    </body>
    </html>

    <html>

    <body>

    <form action=/html/html_form_action.asp>
    男性:
    <input type="radio" name="Sex" value="male" />
    <br />
    女性:
    <input type="radio" name="Sex" value="female" />
    </br>
    <input type="submit" value="提交">
    </form>

    <p>当用户点击一个单选按钮时,该按钮会变为选中状态,其他所有按钮会变为非选中状态。</p>

    </body>
    </html>

    <html>

    <body>

    <form name="input" action="/html/html_form_action.asp" method="get">
    <fieldset>
    <legend>健康信息</legend>
    身高:<input type="text" name="shen_gao" value="1.8"/>
    体重:<input type="text" name="ti_zhong"/>
    </fieldset>
    <input type="submit" value="submit">
    </form>

    <p>如果表单周围没有边框,说明您的浏览器太老了。</p>

    </body>
    </html>

    name="shen_gao" , shen_gao不能用中文文字代替;另外,form标签的name="input"不能缺少

    文本框
    <textarea rows="10" cols="50">
    The cat was playing in the garden.

    </textarea>

    发电子邮件:

    <form action="MAILTO:someone@w3school.com.cn" method="post" enctype="text/plain">

    <h3>这个表单会把电子邮件发送到 W3School。</h3>
    姓名:<br />
    <input type="text" name="name" value="yourname" size="20">
    <br />
    电邮:<br />
    <input type="text" name="mail" value="yourmail" size="20">
    <br />
    内容:<br />
    <input type="text" name="comment" value="yourcomment" size="40">
    <br /><br />
    <textarea rows="10" cols="30" name="textarea_content">
    The cat was playing in the garden.
    </textarea>
    </br>
    <input type="submit" value="发送">
    <input type="reset" value="重置">

    </form>

    发电子邮件,当点击发送,则会自动启动mac上的自带mail软件,

    把以下内容显示在邮件的文本框里作为发送内容

    name=yourname
    mail=yourmail
    comment=yourcomment
    textarea_content=The cat was playing in the garden.

  • 相关阅读:
    二进制位运算
    Leetcode 373. Find K Pairs with Smallest Sums
    priority_queue的用法
    Leetcode 110. Balanced Binary Tree
    Leetcode 104. Maximum Depth of Binary Tree
    Leetcode 111. Minimum Depth of Binary Tree
    Leetcode 64. Minimum Path Sum
    Leetcode 63. Unique Paths II
    经典的递归练习
    案例:java中的基本排序
  • 原文地址:https://www.cnblogs.com/Thermo/p/4230689.html
Copyright © 2011-2022 走看看