<form:checkboxes path="subjects" items="${requestScope.subjects}"  element="label class='checkbox-inline'" itemLabel="name" itemValue="id"/><br/>

生成的代码

<label class="checkbox-inline"><input id="subjects1" name="subjects" type="checkbox" value="8"><label for="subjects1">测试</label></label>
<form:radiobuttons path="receive.accType.id"
                        element="label class='radio' <span style="color:#3366FF;">style='margin-right:4px;'</span>"
                            items="${accTypes }" itemLabel="name" itemValue="id"/>
<form:checkboxes element="label class='checkbox' <span style="color:#3333FF;">style='margin-right:10px;'</span>"
                            items="${accNature }" path="accNature"
                            itemLabel="name" itemValue="id"/>
<form:radiobutton path="arriveway" value="1" checked="true"/>安吉汽车站&emsp;
<form:radiobuttons path="leaderId"
                    items="${requestScope.subject.users }"  element="label class='radio'" itemLabel="name"
                    itemValue="id" />

参考:

Spring MVC框架checkboxes标签的三种使用方式

Spring form 学习之(一)--radiobuttons & checkboxes样式

select

<form:select  class="form-control" path="subject.id" items="${requestScope.subjects}" itemLabel="name"
                    itemValue="id"></form:select>生诚的html代码<select id="subject.id" name="subject.id" class="form-control"><option value="1" selected="selected">英语</option><option value="2">数学</option><option value="3">语文</option></select>

后台取数据@RequestParam(value="subject.id", required=false) Integer subjectId
protected Map referenceData(HttpServletRequest request) throws Exception {
    Map referenceData = new HashMap();
    Map<String,String> country = new LinkedHashMap<String,String>();
    country.put("US", "United Stated");
    country.put("CHINA", "China");
    country.put("SG", "Singapore");
    country.put("MY", "Malaysia");
    referenceData.put("countryList", country);
}
<form:select path="country" items="${countryList}" />
<form:select path="country">
    <form:options items="${countryList}" />
</form:select>

2. <form:options />

The <form:options /> have to enclosed with the select tag.

<form:select path="country">
    <form:options items="${countryList}" />
</form:select>

HTML code

<select id="country" name="country">
   <option value="US">United Stated</option>
   <option value="CHINA">China</option>
   <option value="SG">Singapore</option>
   <option value="MY">Malaysia</option>
</select>

3. <form:option />

The <form:option /> have to enclosed with the select tag as well, and render a single select option, see the following combination.

<form:select path="country">
   <form:option value="NONE" label="--- Select ---"/>
   <form:options items="${countryList}" />
</form:select>

HTML code

<select id="country" name="country">
   <option value="NONE">--- Select ---</option>
   <option value="US">United Stated</option>
   <option value="CHINA">China</option>
   <option value="SG">Singapore</option>
   <option value="MY">Malaysia</option>
</select>

4. List box

To render a list box, just add the “multiple=true” attribute in the select tag.

<form:select path="country" items="${countryList}" multiple="true" />

HTML code, with a hidden value to handle the country selections.

<select id="country" name="country" multiple="multiple">
    <option value="US">United Stated</option>
    <option value="CHINA">China</option>
    <option value="SG">Singapore</option>
    <option value="MY">Malaysia</option>
</select>
<input type="hidden" name="_country" value="1"/> 

form:checkboxes radiobutton select用法的更多相关文章

  1. C#中 Request, Request.params , Request.querystring , Request.Form 区别 与联系用法

    C#中 Request, Request.params , Request.querystring , Request.Form 区别 与联系用法? Request.params , Request ...

  2. spring <form:checkboxes> tag and css class

    I have issue with: <form:checkboxes path="roles" cssClass="checkbox" items=&q ...

  3. how to make form:checkboxes in JSP

    retransmitTable.jsp file: <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix=&qu ...

  4. html select用法总结

    本文将介绍select 原生的常用方法,这些都是经过测试,兼容ie6到ie10,及chrome,火狐等,也就是说大部分浏览器都兼容.如果大家发现有不兼容的情况,可以跟我留言. 我们对基本的用法了如指掌 ...

  5. 网络通信 --> select()用法

    select()用法 头文件 #include <sys/time.h> #include <sys/types.h> #include <unistd.h> 定义 ...

  6. python+selenium七:下拉框、选项框、select用法

    # from selenium import webdriverfrom selenium.webdriver.common.action_chains import ActionChainsimpo ...

  7. golang学习之select用法

    早期的select函数是用来监控一系列的文件句柄,一旦其中一个文件句柄发生IO操作,该select调用就会被返回.golang在语言级别直接支持select,用于处理异步IO问题. select用法同 ...

  8. 数据库Oracle的select用法(部分)

    Oracle的select用法(部分): 1.查询所有: select * from employees; 2.加上where子句:用选择限制行 select * from employees whe ...

  9. 使用layui的form.on绑定select选中事件, form.on()不执行的原因分析

    使用layui的form.on绑定select选中事件中, form.on()不执行, 主要原因有 1, select标签中没有写lay_filter属性,用来监听 <select id=&qu ...

随机推荐

  1. 利用:header匹配所有标题做目录

    1.问题背景 查找到h1-h6,并遍历它们,打印出内容 2.实现源码 <!DOCTYPE html> <html> <head> <meta charset= ...

  2. jquery mobile demo

    <!DOCTYPE html> <html> <head> <title>jQuery Mobile Demo</title> <me ...

  3. Zookeeper 报ConnectionLostException连接丢失错误汇总

    我google出来的几个结果都没有用,这里写出来或许可以帮助别人,这些都是google出来的结果,没有经过验证是否真的能够解决问题. 当前zookeeper的连接状态是connecting,这个时候连 ...

  4. [Django] 问题记录追踪表

    关注的网站: https://simpleisbetterthancomplex.com/ Linux部署 1. Ubuntu下vsftpd安装部署 2. Utuntu下Django+Apache+W ...

  5. 第一百三十六节,JavaScript,封装库--事件绑定

    JavaScript,封装库--事件绑定 在函数库添加两个函数 添加事件绑定函数 删除事件绑定函数 添加事件绑定函数 /** addEvent()函数库函数,跨浏览器添加事件绑定,注意:传入事件名称时 ...

  6. java垃圾回收算法和垃圾收集器

    垃圾收集算法.垃圾回收算法.java垃圾收集器 目录1. 垃圾收集算法1)引用计数法2)根搜索法2. 垃圾回收算法1)复制算法2)标记-清除算法3)标记-整理算法4)分代收集算法3. java垃圾收集 ...

  7. 如何连接OracleRAC

    查看tnsname 查看服务器上tnsname.ora内容: 位置:/oracle/db/product/11.2.0/network/admin/tnsname.ora   连接rac 根据以上信息 ...

  8. 如何让VS检查函数和类Comment的添加情况

    问题: 现在有一个大的项目,我不能确定是否每个类和函数是否已经加上了comments,是否每个comments都是标注正确的. VS中有没有检查Comments的功能? 解决方案: 1.右击proje ...

  9. C# 计算每周和每月固定日期

    最近发现写程序不是简单的实现功能,过程中偶尔伴随者一点小小的算法,比如排序算法,比如周期性的数据等等,发现算法不仅仅需要考虑全面,而且要计算简便.性能优良,而我远远没有达到要求! 一:周.月固定日期 ...

  10. 【BZOJ3813】奇数国 线段树+欧拉函数

    [BZOJ3813]奇数国 Description 给定一个序列,每次改变一个位置的数,或是询问一段区间的数的乘积的phi值.每个数都可以表示成前60个质数的若干次方的乘积. Sample Input ...