JSP:
jquery.min.js jquery.validate.min.js additional-methods.min.js <form role="form" class="form-horizontal" action="u.action" method="post" enctype="multipart/form-data"> <input type="file" name="file" class="form-control" id="file" accept=".csv" placeholder="Please select a csv file"> </form>
JS:
$('.form-horizontal').validate({ rules : { file : { required : true, extension: 'csv', accept : 'text/csv,text/comma-separated-value, application/vnd.ms-excel,application/vnd.msexcel,application/csv' } }, messages : { file : { required : "A csv file is required.", accept : "The file type must be 'CSV'." } } });
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。