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>
    

  • 相关阅读:
    linux网络编程 inet_aton(); inet_aton; inet_addr;
    linux网络编程 ntohs, ntohl, htons,htonl inet_aton等详解
    linux C++ scandir 的使用
    linux 多线程编程-读写者问题
    为什么修改头文件make不重新编译
    syslog(),closelog()与openlog()--日志操作函数
    VC:CString用法整理(转载)
    VC6.0实用小技巧
    HTml js 生成图片
    C++中两个类相互包含引用问题
  • 原文地址:https://www.cnblogs.com/robbychan/p/3786849.html
Copyright © 2011-2022 走看看