jsp 回显显示select
来源:互联网 发布:最终幻想猫女捏脸数据 编辑:程序博客网 时间:2024/05/01 07:42
实现根据不同查询条件查询列表的功能,如图:
查询条件要用form提交:
<div class="lead well">
<form name='form1'>
提现类型:<select name="type" size="1" style="width: 10%" id = "WithDrawType" onchange="WithDrawTypeOnchange()">
<option value ="">请选择</option>
<c:forEach items="${withDrawTypes}" var = "ty">
<option value = "${ty.value}"
<c:if test="${ty.value eq type}">
selected = "selected"
</c:if>> ${ty.description }</option>
</c:forEach>
</select>
<span>
提现渠道: <select name = "channel" size="1" style="width: 10%" id="WithdrawChannel">
<option value ="">请选择</option>
<option value ="1"<c:if test="${1 eq channel }">selected </c:if>>支付宝</option>
<option value ="2" <c:if test="${2 eq channel }">selected </c:if>>微信</option>
</select>
</span>
<label style="width: 20px"></label>
<input type="hidden" value = "${exHandle}" id = "exHandleId"/>
<input class="btn btn-danger" type = "button" value = "查询" onclick="Search()"/>
</form>
</div>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
js:
$(function() {
WithDrawTypeOnchange();
});
function Search() {
var exHandle = $("#exHandleId").val();
if(exHandle == 'true') {
$("form[name='form1']").attr("action",
"<c:url value='/withdraw/exlist'/>");
}else {
$("form[name='form1']").attr("action",
"<c:url value='/withdraw/waitSpds'/>");
}
$("form[name='form1']").submit();
}
function WithDrawTypeOnchange() {
var type = $("#WithDrawType").find("option:selected").val();
if(type != 0) {
$("#WithdrawChannel").find("option[value='']").attr("selected",true);
$("#WithdrawChannel").attr("disabled",true);
}else {
$("#WithdrawChannel").attr("disabled",false);
}
}
---------------------------------------------------------------------------------------------------------------
后端需要传:
model.addAttribute("type", type);
model.addAttribute("channel", channel);
- jsp 回显显示select
- jsp回显数据时,select标签默认被选中和格式化显示日期的问题
- jsp页面数据回显(select下拉选择框)
- jsp select 选择框的回显问题
- jsp页面数据回显(select下拉选择框)
- jsp页面数据回显(select下拉选择框)
- JSP页面select下拉框数据回显
- select下拉框显示,回显和取值
- jsp连接MySQL数据库显示GIS地理数据乱码问题的解决(select AsText(the_geom))
- JSP页面获取select option里面的value和显示内容
- 关于list集合传到jsp,在struts的select标签中显示下拉列表问题
- 【JSP页面】如何根据Select的选项来决定页面input的显示隐藏
- jsp servlet select 传值
- JSP自定义标签(select)
- jsp <select>标签
- jsp select option赋值
- jsp中<select>标签
- struts2 select标签回显和显示传递过来的list
- java并发集合源码分析之currentHashMap分段加锁分析
- 各个代表
- 怎样给黑白图片上色
- leetcode No187. Repeated DNA Sequences
- 能编译成功但是会有许多红色警告解决办法,Xcode从SVN上面check Out
- jsp 回显显示select
- Python 面向对象、继承部分、正则表达式
- 前端代码调试:Webstorm调试js
- Leetcode 342 Power of Four
- Android BLE项目中相应的超时处理机制
- 润乾报表实现排名分析
- Android Studio中获取sha1安全码
- spring boot data redis的三种配置方式
- 在Ubuntu 16.04/14.04 LTS and Debian 8/7安装zabbix Agent