Form Tags

Fieldset and legend tags

fieldset: grouping form fields.

legend: specify a title for each fieldset.

<form action="#" method="POST">
    <fieldset>
        <legend>Contact Info</legend>
        [...]
     </fieldset>
</form>

Form field markup and the label and input tags

For form fields, we have three main tags in HTML: input, select and textarea.

<div>
     <label>Name</label>
    <input type="text" name="name" id="name">  </div>  

#Input type radio (and input type checkbox)   <div>     <label>Gender</label>     <label>       <input type="radio" name="gender" value="m">M</input>     </label>     <label>       <input type="radio" name="gender" value="f">F</input>    </label>   </div> # Input type file   <div>       <label for="file">CV</label>     <input type="file" name="file" id="file"></input>      </div>
<div>
    <label for="state">State</label>
    <select name="state" id="state">
        <option value="">-- Choose --</option>
        <option value="">State 1</option>
        <option value="">State 2</option>
    </select>
</div>
<div>
    <label for="message">Message</label>
     <textarea name="message" id="message" cols="30" rows="10"></textarea>
</div>

Creating buttons 

<button type="submit">Send</button>

Other attribute:

placeholder: If you want a field to have a brief explanation of what the user has to type in it, you can use a `placeholder`

autofoocus: If you want a field to be focused first when the user loads the page, use the boolean attribute `autofocus`

required: you can determine the required fields in the form

时间: 2024-10-06 00:16:46

Form Tags的相关文章

fileupload控件在ajax中无法使用

google得到的方法: 1.http://geekswithblogs.net/ranganh/archive/2008/04/01/file-upload-in-updatepanel-asp.net-ajax.aspx There is a better way of doing it with Ajax Control Toolkit version 3.0.30930 which works with .NET 3.5 SP1 and Visual Studio 2008 SP1. 

atitit.Atitit. Gui控件and面板-----服务端控件 java struts的实现最佳实践

atitit.Atitit.  Gui控件and面板-----服务端控件 java struts的实现最佳实践 1. 服务器控件的类别 1 1.1. 数据控件:该类控件可细分为两种类型:数据源控件和数据绑定控件. 1 1.2. 站点导航控件: 1 1.3. WebParts控件: 1 1.4. 登录控件: 1 1.5. Ajax 控件 1 2. jsf 2 3. Apache  ecs 2 4. Custom ui control... 2 5. Struts UI Tags display d

Snoop resynchronization mechanism to preserve read ordering

A processor employing a post-cache (LS2) buffer. Loads are stored into the LS2buffer after probing the data cache. The load/store unit snoops the loads in the LS2?buffer against snoop requests received from an external bus. If a snoop invalidate requ

自定义标签tld的使用

在JSP中使用标签是很平常的事情,在制作自定义标签时,通常都需要写tld文件来定义标签的各种属性,对应的Java类,前缀等等.标签与tld文件紧紧相连,那么,到底应该怎么放置tld文件?在web.xml中怎么定义tld文件的位置? 以下是具体的分析 Taglib的使用: 首先是在头部申明taglib, uri必须是web.xml定义的,或者是原始tld文件定义的. <%@ taglib prefix="c"uri="http://java.sun.com/jstl/co

spring in action 4 第6章 视图分发

spring 4.0 原生支持13种视图解析器 从spring3.2版本开始,spring支持上述13种解析器,但是spring 3.1不支持Tiles 3 TilesViewResolver,其它的12种都支持. 视图解析器所在的配置文件 @Configuration @EnableWebMvc @ComponentScan("_5BuildingSpringwebapplications") public class WebConfig extends WebMvcConfigur

spring4.1+springmvc4.1+mybatis3.2.8+spring-security3.2.5集成环境建设

在最近使用的项目ssi+spring-security 结构体.建立你自己的家,这是什么环境. 只有记录的目的. 项目结构: 类文件:                                                                                                             配置文件: 视图: 使用的maven作为依赖管理, 下面为pom文件,包括全部项目所需jar 文件: <project xmlns="http

The 10 Most Important Security Controls Missing in JavaEE--reference

JavaEE has some excellent built-in security mechanisms, but they don’t come close to covering all the threats that your applications will face.  Many common attacks like Cross-Site Scripting (XSS), SQL Injection, Cross-Site Request Forgery (CSRF), an

单选框 复选框

一. #!/usr/bin/env python # -*- coding:utf-8 -*- from django.core.exceptions import ValidationError from django import forms as django_forms from django.forms import fields as django_fields from django.forms import widgets as django_widgets from repos

安全工具

Here is a list of security tools that have been collected from the internet. These tools are specifically aimed toward security professionals and enthusiasts/hobbyists for testing and demonstrating security weaknesses. These tools are created for the