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>
    

  • 相关阅读:
    C89:论内存泄漏
    C++03:模板
    C++的STL(标准模板库)系列:容器——string容器
    C++03:论类的友元函数和内联函数
    C++03:论类的运算符重载
    Windows开发:网络编程基础
    Windows开发:论文件和权限
    C89:头文件
    C89:论符号
    纪录片(深度好片)
  • 原文地址:https://www.cnblogs.com/robbychan/p/3786849.html
Copyright © 2011-2022 走看看