ajax加载下拉框和层的拖动

本文介绍了一个用于收集用户反馈并提供意见填写功能的系统,包括意见表达、备注记录及业务处理流程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<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;
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值