zoukankan      html  css  js  c++  java
  • form中的action,submit="return save()"以及ajax提交方法

    <form enctype="multipart/form-data" method="post" name="formform1" id="formform1"action="" onsubmit="">
    <table border="1" cellspacing="0" align="center" bgcolor="#EAEAEA" bordercolor="#EFEFEF" bordercolordark="#ffffff" style="font-size:12px;margin-top: 2px" width=1000px>
    <tr height="30px">
    <td align="center">
    <h5 style="1000px;height:20px;text-align:center;margin-top:30px;margin-bottom:25px;">项目区位图上传</h5>
    项目图类型:<select name="pictype" id="pictype" style="margin-top:20px;">
    <option value="" selected>请选择</option>
    <option value="1">域项目图</option>
    <option value="2">区域项目图</option>
    </select>&nbsp;<input type="file" id="xfile" name="xfile"style="450px;margin-top:20px;" onchange="CheckExt(this)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" name="UploadButton" id="UploadButton" value="上传" onclick="save()"><br>
    </td>
    </tr>
    <tr height="20px"rowspan="1"></tr>
    <tr rowspan="3">
    <td align="center">
    <table border="1" cellspacing="0" align="center" bgcolor="#EAEAEA" bordercolor="#EFEFEF" bordercolordark="#ffffff" style="font-size:12px;margin-top: 2px" width="1000">
    <tr algin="center">
    <td align="center">类别</td>
    <td align="center">操作</td>
    </tr>
    <list picturelist as list>
    <tr>
    <td>
    ${list.TITLE}<input type="hidden" value="${list.SPID}" name="ProjectPic" id="y">
    </td>
    <td>
    <a href="#" onclick="SeePic('${list.PATH}')"><font color="blue">预览</font></a>&nbsp;<a href="#" onclick="deleteProjectPic(${list.SPID})"><font color="blue">删除</font></a>
    </td>
    </tr>
    </list>

    </table>
    </td>
    </tr>

    </table>
    </form>

    2.js

    <script>
      function deleteProjectPic(spid){
    if(confirm("是否删除该信息?")) //弹出确认对话框
    {
    deletePic(spid);//点击确定时执行删除操作。
    }
    }
    function deletePic(spid){
    var timeOut = 1000*60*5;//5分钟
    jQuery.ajax({
    mode:"",
    async:false,
    url:"/Business/NewHouse/DeleteProjectPicAjax.5i5j",
    contentType:"application/x-www-form-urlencoded;charset=UTF-8",
    data:{SPID:spid},
    type:"post",
    timeout:timeOut,
    success:function(data){
    var code="";
    var message="";
    var xmldoc=jQuery.parseXML(data);
    jQuery(xmldoc).find("result").each(function(i)
    {
    code = jQuery(this).children("code").text();
    message = jQuery(this).children("message").text();
    });
    alert(message);
    window.location.href="/Business/NewHouse/NewHouseProjectCheckListView.5i5j";
    },
    error:function(XMLHttpRequest,textStatus,errorThrown){
    if(textStatus == "timeout"){
    alert("连接超时");
    }
    if(typeof ( loading)!="undefined"){
    loading.hide();
    }
    }

    });
    }

    </script>
  • 相关阅读:
    SpringMVC文件上传
    c函数调用过程原理及函数栈帧分析
    《C++游戏开发》笔记十一 平滑动画:不再颤抖的小雪花
    Java学习笔记——IO操作之以图片地址下载图片
    uva 400 Unix ls 文件输出排版 排序题
    【VC++积累】之八、PreTranslageMessage;TranslageMessage;GetMessage和PeekMessage的区别
    uva 331 Mapping the Swaps 求交换排序的map 纯DFS
    uva 10344 23 out of 5 凑运算结果 全排列+dfs
    Java学习笔记——File类文件管理及IO读写、复制操作
    uva 301 Transportation 铁路公司的阳谋 纯dfs暴力
  • 原文地址:https://www.cnblogs.com/mayay/p/6919694.html
Copyright © 2011-2022 走看看