HTML5创建的简易web表单


<!DOCTYPE html>
<!--
 ! Excerpted from "HTML5 and CSS3",
 ! published by The Pragmatic Bookshelf.
 ! Copyrights apply to this code. It may not be used to create training material,
 ! courses, books, articles, and the like. Contact us if you are in doubt.
 ! We make no guarantees that this code is fit for any purpose.
 ! Visit http://www.pragmaticprogrammer.com/titles/bhh5 for more book information.
-->
<html lang="en">
<head>
    <title>AwesomeCo Newsletter</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    <script src="jquery.js"></script>
    <script type="text/javascript">
        $(function(){
            function hasColorSupport(){
                input = document.createElement("input");
                input.setAttribute("type", "color");
                var hasColorType = (input.type !== "text");
                // handle Safari/Chrome partial implementation
                if(hasColorType){
                    var testString = "foo";
                    input.value=testString;
                    hasColorType = (input.value != testString);
                }
                return(hasColorType);
            }
            if (!hasColorSupport()){
                $('input[type=color]').simpleColor();
            }
        });
    </script>
    <style>
        ol{
            padding:0;
            margin:0;
            list-style: none;
        }
        ol li{
            padding:0;
            clear: both;
            margin:0 0 10px 0;
        }
        label{
            float: left;
            width:150px;
        }
    </style>
</head>
<body>
<form method="post" action="/Projects/1">
    <fieldset id="Personal_information">
        <legend>Project Information</legend>
        <ol>
            <li>
                <label for="name">Name</label>
                <input type="text" name="name" autofocus id="name"/>
            </li>
            <li>
                <label for="priority">Priority</label>
                <input type="range" min="0" max="10" name="priority" value="0" id="priority"/>
            </li>
            <li>
                <label for="estimated_hours">Estimated hours</label>
                <input type="number" min="0" max="1000" name="estimated_hours" id="estimated_hours"/>
            </li>
            <li>
                <label for="start_date">Start date</label>
                <input type="date" value="2016-8-11" name="start_date" id="start_date"/>
            </li>
            <li>
                <label for="email">Email contact</label>
                <input type="email" name="email" id="email">
            </li>
            <li>
                <label for="url">Staging URL</label>
                <input type="url" name="url" id="url"/>
            </li>
            <li>
                <label for="project_color">Project color</label>
                <input type="color" name="project_color" id="project_color"/>
            </li>
            <li>
                <input type="submit" value="Submit"/>
            </li>
        </ol>
    </fieldset>
</form>
</body>
</html>




  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值