JavaScript control displays the number of forms

Source: Internet
Author: User
Tags file size file upload window
Javascript| Control | show

<title>untitled document</title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<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 ("You can upload up to 100 file 0 at a time");
Window.form1.upcount.value = 100;
SetID ();
}
else{
for (i=1;i<=window.form1.upcount.value;i++)
str+= ' <div> file ' +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-collapse:collapse" height= "169" >
     <tr bgcolor= "#CC0CCC" >
      <td height= "align=" left "valign=" Middle "bgcolor=" #C0CCCC > 
        <div><font size= "3" ><b> File Upload </b></font></div>
      </td>
     </tr>
    <tr align= "left" valign= "Middle" bgcolor= "#eeeeee" >
 & nbsp;    <td bgcolor= "#eeeeee" height= "valign=" "Top" > <br>
         <table border= "0" cellspacing= "1" cellpadding= "2" >

<tr>
<td><font color= "#FF0000" ><b>*</b></font> uploaded file size cannot exceed <font color= "#FF0000" > 999999999</font> bytes </td>
</tr>
<tr>
<td>

<b><font color= "#FF0000" >*</font></b> can be set up at the same time <font color= "#FF0000" >100</font > Files. <br>

Set the number of uploads
<input type= "Text" value= "1" name= "Upcount" size= ">"
<input type= "button" name= "button" value= "Set" >

</td>
</tr>

        </table>
      </td>
    </tr>
    <tr>
      <td id= "Upid" >
        <div> file 1:
           <input type= "file" name= "File1" >
        </div >
      </td>
    </tr>


</table>
</div>
<br>
<TR align= "center" valign= "Middle" bgcolor= "#eeeeee" >
<TD bgcolor= "#ccc000" height= ">"
<input type= "Submit" name= "Submit" value= "OK" >
<input type= "reset" name= "Submit2" value= "re-hold" >
</td>
</tr>
</table></form>
</body>



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.