Javascript控制显示表单个数

时间:2010-03-29 19:11:58  来源:第二电脑网  作者:第二电脑网

  第二电脑网导读:s" type=text/css rel=stylesheet> <body> <%request.setCharacterEncoding("gb2312"); %> <script type="text/javascript">    function setid()    {    str='<br>';    if(!window.form1.upcount.value)     win...
  正文:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><LINK href="../hellking.Css" type=text/css rel=stylesheet>
<body>
<%request.setCharacterEncoding("gb2312"); %>

<script type="text/JavaScript">
   function setid()
   {
   str='<br>';
   if(!window.form1.upcount.value)
    window.form1.upcount.value=1;
   if(window.form1.upcount.value>100){
   alert("您最多只能同时上传100个文件0");
   window.form1.upcount.value = 100;
   setid();
   }
   else{
    for(i=1;i<=window.form1.upcount.value;i++)
      str+='<div>文件'+i+':<input type="file" name="file'+i+'"></div><br><br>';
   window.upid.innerHTML=str+'<br>';}
   }
 </script>
<form name="form1" method="post" action="BookAction_do.jsp?action=${param.action}" >

  <div>
  <table border="1" cellspacing="0" cellpadding="5" bordercolordark="#CCCCCC" bordercolorlight="#000000" bordercolor="#FFFFFF" style="border-collaphotoshop/ target=_blank class=infotextkey>pse: collapse" height="169">
    <tr bgcolor="#CC0CCC">
      <td height="28" align="left" valign="middle" bgcolor="#C0CCCC">&nbsp;
        <div><font size="3"><b>文件上传</b></font></div>
      </td>
    </tr>
    <tr align="left" valign="middle" bgcolor="#eeeeee">
      <td bgcolor="#eeeeee" height="92" valign="top"> <br>
        <table border="0" cellspacing="1" cellpadding="2">

          <tr>
            <td><font color="#FF0000"><b>*</b></font>上传的文件大小不能超过<font color="#FF0000">999999999</font>个字节</td>
          </tr>
          <tr>
            <td>

              <b><font color="#FF0000">*</font></b>每次可以设置同时上传<font color="#FF0000">100</font>个文件。<br>

              设置上传的个数
              <input type="text" value="1" name="upcount" size="20">
              <input type="button" name="Button"  onClick="setid();" value="设定">

            </td>
          </tr>

        </table>
"Javascript控制显示表单个数"由第二电脑网原创提供,转载请注明:http://www.002pc.com/master/College/Programming/JavaScript/13381.html


关键字:

关于《Javascript控制显示表单个数》文章的评论

站内搜索: 高级搜索

热门搜索: Windows style 系统 tr IP QQ CPU 安装 function 注册 if td