Hi,
If you want to set the limitation by the input value, I suggest you try function "CuteWebUI_AjaxUploader_OnSelect", like the example below.
MaxFilesLimit is the server side property, can not set by the javascript code.
- <?php require_once "phpuploader/include_phpuploader.php" ?>
- <?php session_start(); ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>example</title>
- </head>
- <body>
- <div>
- <input onkeyup="value=value.replace(/[^\d]/g,'') " onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"
- id="no_of_spreads" >
-
- <?php
- $uploader=new PhpUploader();
- $uploader->MultipleFilesUpload=true;
- $uploader->InsertText="Select multiple files (Max 10M)";
- $uploader->AllowedFileExtensions="*.jpg,*.png,*.gif,*.bmp";
- $uploader->Render();
- ?>
-
- <script type='text/javascript'>
- var no_of_spreads= document.getElementById("no_of_spreads");
- function CuteWebUI_AjaxUploader_OnSelect(files)
- {
- if(no_of_spreads.value=="")
- {
- alert("The maximun number of files allowed to be uploaded is set to 0");
- return false;
- }
- if(files.length>no_of_spreads.value)
- {
- alert("The maximun number of files allowed to be uploaded is set to "+no_of_spreads.value);
- return false;
- }
- }
- </script>
- </div>
- </body>
-
- </html>
Regards,
Ken