zoukankan      html  css  js  c++  java
  • [BBS] Reply.jsp 03

    --
    <%@ page language="java" contentType="text/html; charset=gbk"
        pageEncoding="gbk"%>
    
    
    <%
        int id = Integer.parseInt(request.getParameter("id"));
        int rootId = Integer.parseInt(request.getParameter("rootid"));
    %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gbk">
    <title>Insert title here</title>
    
    <script language="javascript">  //javascript 去空格函数 
        function LTrim(str){ //去掉字符串 的头空格
            var i;
            for(i=0;i<str.length; i++) {
                if(str.charAt(i)!=" ") break;
            }
            str = str.substring(i,str.length);
            return str;
        }
        
        function RTrim(str){
            var i;
            for(i=str.length-1;i>=0;i--){
                if(str.charAt(i)!=" "&&str.charAt(i)!=" ") break;
            }
            str = str.substring(0,i+1);
            return str;
        }
        function Trim(str){
        
            return LTrim(RTrim(str));
        
        }
        
        function check() {
            if(Trim(document.reply.title.value) == "") {
                alert("please intput the title!");
                document.reply.title.focus();
                return false;
            }
            
            if(Trim(document.reply.cont.value) == "") {
                alert("plsease input the content!");
                document.reply.cont.focus();
                return false;
            }
            
            return true;
            
        }
    -->
    </script>
    
    </head>
    <body>
        <form name=reply action="ReplyOK.jsp" method="post" onsubmit="check()">
            <input type="hidden" name="id" value="<%=id%>"> 
            <input type="hidden" name="rootid" value="<%=rootId%>">
            <table border="1">
                <tr>
                    <td><input type="text" name="title" size="80"></td>
                </tr>
                <tr>
                    <td><textarea cols="80" rows="12" name="cont"></textarea></td>
                </tr>
                <tr>
                    <td><input type="submit" value="提交"></td>
                </tr>
            </table>
        </form>
    </body>
    </html>
    

  • 相关阅读:
    java+opencv实现图像灰度化
    java实现高斯平滑
    hdu 3415 单调队列
    POJ 3368 Frequent values 线段树区间合并
    UVA 11795 Mega Man's Mission 状态DP
    UVA 11552 Fewest Flops DP
    UVA 10534 Wavio Sequence DP LIS
    UVA 1424 uvalive 4256 Salesmen 简单DP
    UVA 1099 uvalive 4794 Sharing Chocolate 状态DP
    UVA 1169uvalive 3983 Robotruck 单调队列优化DP
  • 原文地址:https://www.cnblogs.com/robbychan/p/3786849.html
Copyright © 2011-2022 走看看