簡體   English   中英

無法自定義引導文件輸入

[英]Unable to customize bootstrap file-input

我正在嘗試在asp.net中實現Bootstrap文件輸入表單GitHub

以下是我的.aspc文件代碼

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">

        <link href="Content/bootstrap.min.css" rel="stylesheet" />
    <script src="Scripts/bootstrap.min.js"></script>
    <script src="bootstrap-fileinput/js/fileinput.js"></script>
    <link href="bootstrap-fileinput/css/fileinput.css" rel="stylesheet" />
    <title></title>
     <script>
         $("#input-id").fileinput({
             'showUpload': false,
             'maxFileCount': 5,
             'showPreview': false,
             'mainClass': "input-group-lg"
         });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <input id="input-id" type="file" class="file-loading" multiple>

    </div>
    </form>
</body>
</html>

有用。 但是我需要自定義它。

  1. 我不希望預覽文件(“ showPreview”:false)
  2. 我不想顯示“上傳”按鈕(“ showUpload”:false)
  3. 我想限制文件數量(“ maxFileCount”:5)

我已使用必需的插件進行自定義。

但是我仍然得到默認的預覽/輸出。

有人可以幫忙嗎?

謝謝你的幫助。

您的代碼有小錯誤。 您需要在輸入標簽中添加“ multiple”指令,並將類更改為“ file-loading”。

<form id="form1" runat="server">
  <div>
    <input id="input-id" type="file" class="file-loading" multiple>
  </div>
</form>

這是一個有效的演示: https : //jsfiddle.net/16jut54d/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM