in case of input type file
the value is stored in array
as files
with key name
.
$('input#my_id').change(function(){var files = $(this)[0].files;if(files.length >10){
alert("you can select max 10 files.");}else{
alert("correct, you have selected less than 10 files");}});
fiddle example : http://jsfiddle.net/nze2B/3/
amychang2014 發表在 痞客邦 留言(0) 人氣()
<formaction="upload"enctype="multipart/form-data"method="post">
Upload image:
<inputid="image-file"type="file"name="file"/><inputtype="submit"value="Upload"/><scripttype="text/javascript">
$('#image-file').bind('change',function(){
alert('This file size is: '+this.files[0].size/1024/1024+"MB");});</script></form>
amychang2014 發表在 痞客邦 留言(0) 人氣()
http://blog.miniasp.com/post/2008/01/13/How-to-let-ASPNET-State-Service-allow-remote-connection.aspx
當用APS.NET語言所建立的網站(或者安裝 ASP.NET Hotfix後 ),出現下列的錯誤訊息時:
amychang2014 發表在 痞客邦 留言(0) 人氣()
System.IO.Stream fs1 = new System.IO.FileStream(this.openFileDialog1.FileName,
System.IO.FileMode.Open, System.IO.FileAccess.Read);
amychang2014 發表在 痞客邦 留言(0) 人氣()
ArrayList values =newArrayList();
amychang2014 發表在 痞客邦 留言(0) 人氣()
<asp:comparevalidator runat="server"
errormessage="The date must be greater than today"
controltovalidate="txtDate1" type="date"
valuetocompare="<%# DateTime.Today.ToShortDateString() %>" />
amychang2014 發表在 痞客邦 留言(0) 人氣()
<asp:CheckBoxListID="x"runat="server">
<asp:ListItem Text="Image: <imgsrc='Images/PlusSign.gif'/> works"></asp:ListItem>
<asp:ListItem Text="Image: <imgsrc='Images/XSign.gif'/> works"></asp:ListItem>
</asp:CheckBoxList>
amychang2014 發表在 痞客邦 留言(0) 人氣()
amychang2014 發表在 痞客邦 留言(0) 人氣()
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="FileUpload2"
ErrorMessage="路徑有誤" ValidationExpression="^([a-zA-Z].*|[1-9].*)\.(doc|DOC|pdf|PDF|rtf|RTF)$">
</asp:RegularExpressionValidator>
amychang2014 發表在 痞客邦 留言(0) 人氣()
amychang2014 發表在 痞客邦 留言(0) 人氣()