<div id="divForm">
<table width="550" border="0" cellspacing="0" cellpadding="0" class="tableborder">
<tr>
<td class="td_title" nowrap="nowrap">
意见:<br>
</td>
<td class="td_content" nowrap="nowrap">
<select id="yj" onchange="change()">
<br>
</td>
</tr>
<tr id="re">
<td class="td_title">
备注 :
</td>
<td class="td_content">
<textarea rows="5" cols="58" class="textarea" id="bz"></textarea>
</td>
</tr>
</table>
</div>
<script>
$(function(){
$('#divForm').dialog({
bgiframe: true,
autoOpen: false,
title: '请您填写基本合格或不合格的意见',
width: 600,
height: 230,
modal: true,
overlay: {
backgroundColor: '#000',
opacity: 0.3
},
buttons: {
'保存' : function() {
var id=document.getElementById("csid").value;
var spzt=document.getElementById("spzt").value;
var bz=document.getElementById("bz").value;
updateClick(id,spzt,bz); //做业务处理
$(this).dialog('close');
} ,
'取消' : function() {
$(this).dialog('close');
}
}
});
});
function dialogInfo(){
$('#divForm').dialog('open');
}
function showdiv(spzt,type){
var op=document.getElementById("yj");
$.ajax({
url:'${path}/sys/codeMap.TJ?method=queryMessage&type='+type,
method:'post',
success:function(str){
str = eval("("+str+")");
op.length=0;
for(var i=0;i<str["aaa"].length;i++){
op.options.add(new Option(str["aaa"][i].codekey,str["aaa"][i].codevalue));
}
}
});
document.getElementById("re").style.display="none";
document.getElementById("bz").innerText="";
document.getElementById("spzt").value=spzt;
dialogInfo();
}
<script>
后台:
public ActionForward queryMessage(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
SysBaseCodeMapService service = (SysBaseCodeMapService) this.getBean("sysBaseCodeMapService");
List<TSysBasecodemap> list=service.selectAllByCode(code);
Map map = new HashMap();
map.put("aaa", list);
JSONObject jsObject = JSONObject.fromObject(map);
String str=jsObject.toString();
response.setCharacterEncoding("utf-8");
response.getWriter().print(str);
return null;
}