html表单 第四节

实例:

<html>
<head>
    <title>表单实例</title>
</head>
<body>
<center>
    <h1><font color="blue">表单</font></h1>
    <hr width="80%" color="green"/>
    <form action="index.html" method="GET">
        <table border="1" width="500px" cellpadding="5" cellspacing="0" align="center">
            <tr>
                <th colspan="2">学员注册表</th>
            </tr>
            <!--readonly="readonly" disabled="disabled" -->
            <tr>
                <td>姓名:</td><td><input type="text" nam="username" size="19" value="" maxlength="6" /></td>
            </tr>
            <tr>
                <td>密码</td><td><input type="password" name="password"/></td>
            </tr>
            <tr>
                <td>性别</td>
                <td>
                    <input type="radio" name="sex" value="男" checked="checked" />男
                    <input type="radio" name="sex" value="女"/>女
                </td>
            </tr>
            <tr>
                <td>爱好</td>
                <td>
                    <input type="checkbox" name="loves" value="篮球" checked="checked"/>篮球
                    <input type="checkbox" name="loves" value="游戏"/>游戏
                    <input type="checkbox" name="loves" value="学习"/>学习
                    <input type="checkbox" name="loves" value="唱歌"/>唱歌
                </td>
            </tr>
            <tr>
                <td>sql操作</td>
                <td>
                    <select name="clazz">
                        <option value="add">add</option>
                        <option value="sel">sel</option>
                        <option value="upd">upd</option>
                        <option value="del">del</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>照片:</td>
                <td>
                    <input type="file" name="photo" size="40"/>
                </td>
            </tr>
            <tr>
                <td>备注</td>
                <td>
                    <textarea rows="6" cols="40">
                    </textarea>
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <input type="submit" value="提交"/>
                    <input type="reset" value="重填"/>
                    <input type="button" value="按钮" onclick="alert('hello world')"/>
                    <input type="image" src="11.gif" alt="提交表单"/>
                    <input type="hidden" name="hidden" value="learn" />
                </td>
            </tr>
        </table>
    </form>
    </center>
</body>
</html>

 结果:

原文地址:https://www.cnblogs.com/feilongblog/p/4587284.html