spring mvc 2个select框取值
来源:互联网 发布:js实现pdf在线阅读 编辑:程序博客网 时间:2024/06/10 04:01
首先,js代码
function test(){ var pro=$("#activity_project").val(); $.ajax({ type: "POST", url: "${pageContext.request.contextPath}/video/selectchild", data: { //发送给数据库的数据 idKey:pro }, dataType: 'json', success: function(data) { $("#activity_taskid").empty(); $.each(data.tasks, function(index,item){ //alert(item.specification); //$("#activity_taskid").empty(); $("#activity_taskid").append("<option>"+item.specification+"</option>"); }); } }); }
然后是页面代码
<tr><td>频道:</td><td><sf:select id="activity_project" path="category" onchange="test()" style="width:150px"> <sf:option value="0">--请选择--</sf:option> <sf:options items="${categoryList}"/> </sf:select></td></tr> <tr><td>栏目:</td> <td> <sf:select id="activity_taskid" path="colunm" style="width:150px"> <sf:option value="0" id="selectchild">--请选择--</sf:option> </sf:select></td></tr>controller代码
List<Category> categoryListchild=null; categoryListchild=videoService.getlist(hql); Map josnMap = new HashMap(); List list=new ArrayList(); if(categoryListchild.size()>0){ for(int i=0;i<categoryListchild.size();i++){ String name=categoryListchild.get(i).getName(); Map taskMap=new HashMap(); taskMap.put("specification",name); list.add(taskMap); } } josnMap.put("tasks",list); return JSONObject.fromObject(josnMap);
0 0
- spring mvc 2个select框取值
- 第一个SPRING MVC BeanNameUrlHandlerMapping
- spring mvc第一个helloword
- 第一个spring mvc示例
- 第一个Spring MVC应用
- 第一个Spring MVC应用
- 【Spring MVC】完成Spring 3 MVC的第一个实例
- MVC Jquery 实现多个select 无刷新联动
- Spring MVC 标签之select,option和options标签
- Spring MVC框架select,option和options标签的使用
- Spring MVC框架select,option和options标签的使用
- Spring MVC第一个简单配置实例
- Spring MVC表单提交多个对象
- 我的第一个Spring MVC实例
- 引用多个spring-mVC配置文件
- 【推荐】第一个SPRING MVC BeanNameUrlHandlerMapping
- spring mvc 配置多个dispatcherservlet
- Spring MVC 多个文件上传
- tomcat7下启动jmx服务
- 应用程序中嵌入的网页运行时出现“脚本错误”解决方法
- 九度OJ 题目1059:abc
- leetcode 141: Linked List Cycle
- SO_REUSEADDR说明
- spring mvc 2个select框取值
- hdu3709 Balanced Number 数位dp
- Java 解決BufferedReader读取UTF-8文件中文乱码
- hdu 5400 Arithmetic Sequence 2015多校联合训练赛#9 枚举
- Oracle数据字典详解
- c++ primer plus 第九章《编程题9.6.2》
- Invert Binary Tree
- Oracle Query Performance Tuning: 12–Step Program
- Android设计模式系列-适配器模式