<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. 如何用redis/memcache做Mysql缓存层

    方法一:直接用MysqlMysql有缓存,实现了类似的功能,如果需要缓存的东西很多,可以把缓存的内存设置大一点.这样的好处就是不用去控制缓存的失效,确保数据一致性. 方法二:启用用DAO框架的缓存比如 ...

  2. EJB的优点有哪些?(选择2项)

    EJB的优点有哪些?(选择2项) A.技术领先 B.价格低廉 C.性能优越 D.强大的容器支持 解答:CD

  3. TempData,跳转后的提醒

    TempData与ViewData用法一样,不同的是ViewData是当前action与对应的view中存在,TempData在下个action还有效,再往后就无效了.只是我的浅薄理解,希望不会误人子 ...

  4. windows 下安装securecrt 绿色版

  5. (转)ReentrantLock与Synchronized同步区别

    转自:http://blog.csdn.net/fw0124/article/details/6672522 原文:http://www.ibm.com/developerworks/cn/java/ ...

  6. 如何连接OracleRAC

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

  7. SQL Server 数据库分离与附加(图文教程)

    from:http://www.jb51.net/article/36624.htm 一.概述 SQL Server提供了“分离/附加”数据库.“备份/还原”数据库.复制数据库等多种数据库的备份和恢复 ...

  8. poj 2752 Seek the Name, Seek the Fame (KMP纯模版)

    Seek the Name, Seek the Fame Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 13840   Ac ...

  9. Echoprint系列--编译

    近期要做一个音乐相关的client.当中一个功能是音乐识别.搜索了一些资料选择Echoprint来开发.Echoprint是开源免费的,并且多种client都支持能节约非常多时间,今天主要下载和编译源 ...

  10. 使用Lingo增强JMS

    虽然activemq+jencks的jms轻量级解决方案已经很好地在psa中work了,尤其spring的JmsTemplate使得代码更简单,但是还是存在问题. 问题来自暑期做psa的时候,link ...