<!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表单——实现交互
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...