js知识
1:取输入框==里的值
var strr=$("#checked").val();
2:取dom对象的属性直接dom对象+“.”后面跟属性
dom.attr("attribute")有时不太好使
checkbox[j].value checkbox[j].checked
3:修改数据时,对于多选框的值得回显在action中获得多选框对应的字段的值,拼成字符串传到页面
<body onload="showH()"> .. <s:checkboxlist name="aids" list="#request.yffzjyTypes" listKey="aid" listValue="lxmc" ></s:checkboxlist> .. function showH(){ var strr=$("#checked").val(); var checkbox=document.getElementsByName("aids"); var arr=strr.split(","); for(var i=0;i<arr.length;i++){ for(var j=0;j<checkbox.length;j++){ if(arr[i].trim()==checkbox[j].value){ checkbox[j].checked=true; } } } }
4:动态加载多选框可以直接传入对象,listKeylistValue规定他的显示与要传的值同理的下拉菜单
<s:checkboxlist name="aids" list="#request.yffzjyTypes" listKey="aid" listValue="lxmc" ></s:checkboxlist> <s:select name="typeid" list="yffzjyTypes" listKey="aid" listValue="lxmc" headerKey="00" headerValue="教育类型"></s:select>
$("#photo4").attr({"src":"<%=basePath%>/images/jdxw_07.png"}); $("#articlecontent").css({"display":"none"});
<s:action name="JdjNews_findByFirstTypeIdjiaodianxinwen" namespace="/"></s:action>
相关推荐
luvhl 2020-08-17
liaoxuewu 2020-06-26
北京老苏 2020-06-25
Lophole 2020-06-14
SIMONDOMAIN 2020-06-14
firstboy0 2020-06-14
88274956 2020-11-03
Zhongmeishijue 2020-09-10
runner 2020-09-01
梦的天空 2020-08-25
IdeaElements 2020-08-19
移动开发与培训 2020-08-16
ReunionIsland 2020-08-16
lyqdanang 2020-08-16
NARUTOLUOLUO 2020-08-03
MyNameIsXiaoLai 2020-07-08
星辰的笔记 2020-07-04
csstpeixun 2020-06-28
letheashura 2020-06-26