這段JavaScript代碼只適用於IE爲什麼以及如何使它在Firefox和Chrome上工作。 在此先感謝。javascript適用於IE,但不適用於Firefox和Chrome
的Javascript
function uploadFileChange() {
if (document.getElementById('textbox1').value != document.getElementById("FileUpload1").value) {
document.getElementById('textbox1').value = document.getElementById("FileUpload1").value;
}
return false;
}
HTML/asp.net
<div class="fileinputs">
<!-- Upload file invisivel-->
<asp:FileUpload ID="FileUpload1" ClientIDMode="Static" class="file" runat="server"
onpropertychange="uploadFileChange();" />
<!-- button e textbox falsas para poder dar syles ao button-->
<div class="fakefile">
<asp:TextBox ID="textbox1" CssClass="textbox" ClientIDMode="Static" runat="server"
Width="31%" ReadOnly="true" />
<asp:Button ID="FileChooserButton1" CssClass="btnSubmit" runat="server" Text="Procurar..."
ForeColor="White" />
<asp:Button ID="FileChooserButton2" CssClass="btnSubmit" Text="Apagar" ForeColor="White"
OnClientClick="clear();" runat="server" />
</div>
</div>
議決
向我們展示你的HTML – animaonline
你是如何加載JS到網頁內嵌或外置 – 2012-05-11 11:34:31
的JS您使用ASP.NET 4.0加載內嵌 –