美文网首页
Chapter 14 HTML表单——实现交互

Chapter 14 HTML表单——实现交互

作者: Smnag | 来源:发表于2019-03-23 12:29 被阅读0次
<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <title>The Starbuzz Bean Machine</title>
    <link rel="stylesheet" href="starbuzz.css">
    <link rel="stylesheet" href="styledform.css">
  </head>
  <body>

    <h1>The Starbuzz Bean Machine</h1>
    <h2>Fill out the form below and click "order now" to order</h2>

    <form action="http://www.starbuzzcoffee.com/processorder.php" method="post">/*------action属性包含服务器脚本的url*/
    <div class="tableRow">
        <p>
          Choose your beans:
        </p>
        <p>
            <select name="beans">/*------select为下拉菜单*/
              <option value="House Blend">House Blend</option>
              <option value="Bolivia">Shade Grown Bolivia Supremo</option>
              <option value="Guatemala">Organic Guatemala</option>
              <option value="Kenya">Kenya</option>
            </select>
        </p>
    </div>
    <div class="tableRow">
        <p> Type: </p>
        <p>
            <input type="radio" name="beantype" value="whole"> Whole bean<br>/*------radio为单选输入*/
            <input type="radio" name="beantype" value="ground" checked> 
            Ground
        </p>
    </div>
    <div class="tableRow">
        <p> Number of bags: </p>
        <p> <input type="number" name="bags" min="1" max="10"> </p>/*------number为数字输入*/
    </div>
    <div class="tableRow label">
        <p> Must arrive by date: </p>
        <p> <input type="date" name="date"> </p>
    </div>
    <div class="tableRow">
        <p> Extras: </p>
        <p>
            <input type="checkbox" name="extras[]" value="giftwrap"> Gift wrap<br>/*------checkbox为复选框*/
            <input type="checkbox" name="extras[]" value="catalog" checked>/*------checked为布尔属性,默认选择*/
            Include catalog with order
        </p>
    </div>
    <div class="tableRow">
        <p class="heading"> Ship to </p>
        <p></p>
    </div>
    <div class="tableRow">
        <p> Name: </p>
        <p> <input type="text" name="name" value="" placeholder="Buckaroo Banzai" required> </p>
    </div>
    <div class="tableRow">
        <p> Address: </p>
        <p> <input type="text" name="address" value="" placeholder="Banzai Institute" required> </p>
    </div>
    <div class="tableRow">
        <p> City: </p>
        <p> <input type="text" name="city" value="" placeholder="Los Angeles" required> </p>
    </div>
    <div class="tableRow">
        <p> State: </p>
        <p> <input type="text" name="state" value="" placeholder="CA" required> </p>
    </div>
    <div class="tableRow">
        <p> Zip: </p>
        <p> <input type="text" name="zip" value="" placeholder="90050" required> </p>
    </div>
    <div class="tableRow">
        <p> Phone: </p>
        <p> <input type="tel" name="phone" value="" placeholder="310-555-1212" required> </p>/*------tel仅允许数字输入,required为必填项*/
    </div>
    <div class="tableRow">
        <p> Customer Comments: </p>
        <p>
            <textarea name="comments"></textarea>/*------textarea为多行输入*/
        </p>
    </div>
    <div class="tableRow">
        <p></p>
        <p> <input type="submit" value="Order Now"> </p>
    </div>
    </form>
  </body>
</html>

相关文章

  • Chapter 14 HTML表单——实现交互

  • HTML表单

    什么是HTML表单 表单是实现用户和网站或者应用程序实现交互的方式之一。它允许用户将数据发送到网站。 HTML表单...

  • html表单用法

    html表单用途 html用于收集用户的输入向服务端提交数据,从而实现用户与web端的交互 html表单的属性 1...

  • from表单用法简单介绍

    前言: HTML里的FORM是用来创建一个表单,实现与本页或其它页面的数据交互。表单能够包含 input 元素,比...

  • Form表单小结

    1、form表单作用以及属性 Form表单是HTML里面用来创建一个表单,用来与后台服务器或者其他页面实现数据交互...

  • HTML表单

    HTML 表单用于接收不同类型的用户输入,用户提交表单时向服务器传输数据,从而实现用户与Web服务器的交互。 表单...

  • hc6(5-1~5-9)

    使用表单标签,与用户交互 网站怎样与用户进行交互?答案是使用HTML表单(form)。表单是可以把浏览者输入的数据...

  • HTML+CSS学习笔记(5)- 与浏览者交互,表单标签

    1、使用表单标签,与用户交互 网站怎样与用户进行交互?答案是使用HTML表单(form)。表单是可以把浏览者输入的...

  • HTML 表单的用法

    HTML 表单用于搜集不同类型的用户输入。HTML表单是用户交互中非常强大的工具。使用 元素来定义一个HTML表单...

  • 表单标签

    1.使用表单标签,与用户交互 网站怎样与用户进行交互?答案是使用HTML表单(form)。表单是可以把浏览者输入的...

网友评论

      本文标题:Chapter 14 HTML表单——实现交互

      本文链接:https://www.haomeiwen.com/subject/wnnjvqtx.html